this repo has no description
1include "subgraph.mzn";
2
3predicate fzn_reachable(array[int] of $$N: from, array[int] of $$N: to,
4 var $$N: r, array[$$N] of var bool: ns, array[int] of var bool: es) =
5 let {
6 int: E = length(es);
7 set of int: NODE = min(index_set(ns))..max(index_set(ns));
8 array[1..2*E] of NODE: dfrom = from ++ to;
9 array[1..2*E] of NODE: dto = to ++ from;
10 array[1..2*E] of var bool: des = es ++ es;
11 array[NODE] of var bool: dns = array1d(NODE,ns);
12 var NODE: dr = r;
13 } in
14 /* duplicate the edges so that we can use directed graph reachability */
15 fzn_dreachable(dfrom,dto,dr,dns,des);
16
17%-----------------------------------------------------------------------------%