4
* Gr�goire Dooms <dooms@info.ucl.ac.be>
7
* Gr�goire Dooms (Universit� catholique de Louvain), 2005
10
* $Date: 2005-11-29 10:57:21 +0100 (Tue, 29 Nov 2005) $
13
* This file is part of CP(Graph)
15
* See the file "contribs/graph/LICENSE" for information on usage and
16
* redistribution of this file, and for a
17
* DISCLAIMER OF ALL WARRANTIES.
21
#include "path/pathdegree.icc"
22
namespace Gecode { namespace Graph {
24
/** \brief Posts a degree constraint on the graph view g.
26
* All nodes of g have indegree of 1 (except start) and out degree of 1 (except end)
29
template <class GView>
30
void pathdegree(Space *home, GView &g, int start, int end){
31
GECODE_ES_FAIL(home, PathDegreePropag<GView>::post(home, g, start, end));
36
/** \brief posts a simple path constraint on the graph view g.
38
* The propagator uses cost filtering based on the upper bound of w and updates the lower bound of w.
41
template <class GView>
42
void path(Space* home, GView &g, int start, int end, const map <pair<int,int>,int> &edgecosts, IntVar w) {
43
if (home->failed()) return;
44
GECODE_ME_FAIL(home, g._nodeIn(home, start));
45
GECODE_ME_FAIL(home, g._nodeIn(home, end));
46
pathdegree(home,g,start,end);
47
GECODE_ES_FAIL(home, PathCostPropag<GView>::post(home, g, start, end, w, edgecosts));
49
/** \brief posts a path constraint on the graph view g.
52
template <class GView>
53
void path(Space* home, GView &g, int start, int end) {
54
if (home->failed()) return;
55
GECODE_ME_FAIL(home, g._nodeIn(home, start));
56
GECODE_ME_FAIL(home, g._nodeIn(home, end));
57
pathdegree(home,g,start,end);
58
GECODE_ES_FAIL(home, PathPropag<GView>::post(home, g, start, end));
62
#include "path/path.icc"