this repo has no description
1include "fzn_tree_int.mzn";
2include "fzn_tree_int_reif.mzn";
3include "fzn_tree_enum.mzn";
4include "fzn_tree_enum_reif.mzn";
5include "fzn_dtree_int.mzn";
6include "fzn_dtree_int_reif.mzn";
7include "fzn_dtree_enum.mzn";
8include "fzn_dtree_enum_reif.mzn";
9
10/** @group globals.graph
11 Constrains the subgraph \a ns and \a es of a given directed graph to be a tree rooted at \a r.
12
13 \a N is the number of nodes in the given graph
14 \a E is the number of edges in the given graph
15 \a from is the leaving node 1..\a N for each edge
16 \a to is the entering node 1..\a N for each edge
17 \a r is the root node (which may be variable)
18 \a ns is a Boolean for each node whether it is in the subgraph
19 \a es is a Boolean for each edge whether it is in the subgraph
20*/
21predicate dtree(int: N, int: E, array[int] of int: from, array[int] of int: to,
22 var int: r, array[int] of var bool: ns, array[int] of var bool: es) =
23 assert(index_set(from) = 1..E,"dtree: index set of from must be 1..\(E)") /\
24 assert(index_set(to) = 1..E,"dtree: index set of to must be 1..\(E)") /\
25 assert(index_set(ns) = 1..N,"dtree: index set of ns must be 1..\(N)") /\
26 assert(index_set(es) = 1..E,"dtree: index set of es must be 1..\(E)") /\
27 fzn_dtree(N,E,from,to,r,ns,es);
28
29/** @group globals.graph
30 Constrains the subgraph \a ns and \a es of a given directed graph to be at tree rooted at \a r.
31
32 \a from is the leaving node for each edge
33 \a to is the entering node for each edge
34 \a r is the root node (which may be variable)
35 \a ns is a Boolean for each node whether it is in the subgraph
36 \a es is a Boolean for each edge whether it is in the subgraph
37*/
38predicate dtree(array[int] of $$N: from, array[int] of $$N: to,
39 var $$N: r, array[$$N] of var bool: ns, array[int] of var bool: es) =
40 assert(index_set(from) = index_set(to),"dreachable: index set of from and to must be identical") /\
41 assert(index_set(from) = index_set(es),"dreachable: index set of from and es must be identical") /\
42 assert(dom_array(from) subset index_set(ns),"dreachable: nodes in from must be in index set of ns") /\
43 assert(dom_array(from) subset index_set(ns),"dreachable: nodes in to must be in index set of ns") /\
44 fzn_dtree(from,to,r,ns,es);
45
46%-----------------------------------------------------------------------------%
47
48/** @group globals.graph
49 Constrains the subgraph \a ns and \a es of a given undirected graph to be a tree rooted at \a r.
50
51 \a N is the number of nodes in the given graph
52 \a E is the number of edges in the given graph
53 \a from is the leaving node 1..\a N for each edge
54 \a to is the entering node 1..\a N for each edge
55 \a r is the root node (which may be variable)
56 \a ns is a Boolean for each node whether it is in the subgraph
57 \a es is a Boolean for each edge whether it is in the subgraph
58*/
59predicate tree(int: N, int: E, array[int] of int: from, array[int] of int: to,
60 var int: r, array[int] of var bool: ns, array[int] of var bool: es) =
61 assert(index_set(from) = 1..E,"tree: index set of from must be 1..\(E)") /\
62 assert(index_set(to) = 1..E,"tree: index set of to must be 1..\(E)") /\
63 assert(index_set(ns) = 1..N,"tree: index set of ns must be 1..\(N)") /\
64 assert(index_set(es) = 1..E,"tree: index set of es must be 1..\(E)") /\
65 fzn_tree(N,E,from,to,r,ns,es);
66
67/** @group globals.graph
68 Constrains the subgraph \a ns and \a es of a given undirected graph to be at tree rooted at \a r.
69
70 \a from is the leaving node for each edge
71 \a to is the entering node for each edge
72 \a r is the root node (which may be variable)
73 \a ns is a Boolean for each node whether it is in the subgraph
74 \a es is a Boolean for each edge whether it is in the subgraph
75*/
76predicate tree(array[int] of $$N: from, array[int] of $$N: to,
77 var $$N: r, array[$$N] of var bool: ns, array[int] of var bool: es) =
78 assert(index_set(from) = index_set(to),"dreachable: index set of from and to must be identical") /\
79 assert(index_set(from) = index_set(es),"dreachable: index set of from and es must be identical") /\
80 assert(dom_array(from) subset index_set(ns),"dreachable: nodes in from must be in index set of ns") /\
81 assert(dom_array(from) subset index_set(ns),"dreachable: nodes in to must be in index set of ns") /\
82 fzn_tree(from,to,r,ns,es);