Sha256: c9c6a4a134830485dd67a58d0022f65416157d79617fa4200a9fa9887cc53f66

Contents?: true

Size: 1.87 KB

Versions: 1

Compression:

Stored size: 1.87 KB

Contents

/*
 *  Main authors:
 *     Grégoire Dooms <dooms@info.ucl.ac.be>
 *
 *  Copyright:
 *     Grégoire Dooms (Université catholique de Louvain), 2005
 *
 *  Last modified:
 *     $Date: 2005-11-29 10:57:21 +0100 (Tue, 29 Nov 2005) $
 *     $Revision: 271 $
 *
 *  This file is part of CP(Graph)
 *
 *  See the file "contribs/graph/LICENSE" for information on usage and
 *  redistribution of this file, and for a
 *     DISCLAIMER OF ALL WARRANTIES.
 *
 */

#include "path/pathdegree.icc"
namespace Gecode { namespace Graph {

/** \brief Posts a degree constraint on the graph view g.
 *
 * All nodes of g have indegree of 1 (except start) and out degree of 1 (except end)
 * \ingroup TaskModel
 */
template <class GView>
    void pathdegree(Space *home, GView &g, int start, int end){
        GECODE_ES_FAIL(home, PathDegreePropag<GView>::post(home, g, start, end));
}



/** \brief posts a simple path constraint on the graph view g. 
 *
 * The propagator uses cost filtering based on the upper bound of w and updates the lower bound of w.
 * \ingroup TaskModel
 */
template <class GView>
void path(Space* home, GView &g, int start, int end, const map <pair<int,int>,int> &edgecosts, IntVar w) {
        if (home->failed()) return;
        GECODE_ME_FAIL(home, g._nodeIn(home, start));
        GECODE_ME_FAIL(home, g._nodeIn(home, end));
        pathdegree(home,g,start,end);
        GECODE_ES_FAIL(home, PathCostPropag<GView>::post(home, g, start, end, w, edgecosts));
}
/** \brief posts a path constraint on the graph view g.
 * \ingroup TaskModel
 */
template <class GView>
void path(Space* home, GView &g, int start, int end) {
        if (home->failed()) return;
        GECODE_ME_FAIL(home, g._nodeIn(home, start));
        GECODE_ME_FAIL(home, g._nodeIn(home, end));
	    pathdegree(home,g,start,end);
        GECODE_ES_FAIL(home, PathPropag<GView>::post(home, g, start, end));
}

} }
#include "path/path.icc"


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gecoder-with-gecode-0.7.1 ext/gecode-1.3.1/contribs/graph/path.icc