260 likes | 450 Views
Rooted Tree and Spanning Tree Constraints. Patrick Prosser and Chris Unsworth. What’s new? Two (or 4) new specialised constraints presented rooted tree spanning tree spanning tree = connected & noCycle. Who cares (motivation)? Applications in network design such as clock trees
E N D
Rooted Tree and Spanning Tree Constraints Patrick Prosser and Chris Unsworth
What’s new? • Two (or 4) new specialised constraints presented • rooted tree • spanning tree • spanning tree = connected & noCycle • Who cares (motivation)? • Applications in network design • such as clock trees • A fundamental property of graphs • Application to graph theoretical problems • possibly superTree construction (phylogenetics)
The rooted tree constraint The “single successor” model (so named by Gregoire Dooms) Typically used in “tour” problems (TSP & VRP) Variables Domains Instantiation
The rooted tree constraint Inspiration: Subtour elimination constraint Caseau & Laburthe “Solving small TSPs with constraints” (ICLP 1997) Example of a rooted tree using “single successor” model: 3 4 0 2 1 5
The rooted tree constraint Uses the following “backtrackable” variables initialised (<=) as follows is root of subtree that contains node i nodes in subtree rooted on node i
Intuition behind the rooted tree constraint r j i node j becomes parent of node i find root of tree that contains node j update descendants of root node r PROPAGATE: node/variable r is not allowed to “point” to any of its descendants (otherwise we have a cycle) Update all nodes in tree rooted on node i so that they now have node r as root Read the paper for details
Intuition behind the rooted tree constraint j i node j becomes the root of the tree PROPAGATE: no other node can become the root, remove value k from node\variable k, for all k not equal to j Read the paper for details
Intuition behind the rooted tree constraint • Note: graph is connected • every node\variable must take a value • only one root
The spanning tree constraint The “adjacency matrix” model Variables Domains edge rejected Instantiation (multi) edge selected
The spanning tree constraint • Constraint initially in two parts • connected • noCycle
The simple connectivity constraint Uses the following “backtrackable” variables The set of indices of nodes in the ith component The location/component of node i Residual degree, number of potential edges Number of components in the graph
Intuition behind the simple connectivity constraint j i j i Uses the CONNECTED-COMPONENTS algorithm from Corman, Leirson and Rivest, employing disjoint sets Add edge (i,j) Merge components Decrement number of components Decrement number of free edges (rDeg)
Intuition behind the simple connectivity constraint j i Reject edge (i,j) Decrement number of free edges (rDeg) If insufficient free edges remain (less than components – 1) then fail NOTE: no propagation. Only test for failure. Dumb But quite fast
Intuition behind the simple connectivity constraint For a smart connectivity constraint that actually propagates see our ECAI 2006 paper “A Connectivity Constraint using Bridges” End of shameless plug
The noCycle constraint Uses the following “backtrackable” variables The set of indices of nodes in the ith component The location/component of node i
Intuition behind the noCycle constraint Uses the CONNECTED-COMPONENTS algorithm from Corman, Leirson and Rivest, employing disjoint sets Add edge (i,j) Broken lines are potential/free edges
Intuition behind the noCycle constraint Uses the CONNECTED-COMPONENTS algorithm from Corman, Leirson and Rivest, employing disjoint sets Add edge (i,j) PROPAGATE: Remove potential/free edges between components
Intuition behind the noCycle constraint Uses the CONNECTED-COMPONENTS algorithm from Corman, Leirson and Rivest, employing disjoint sets Add edge (i,j) PROPAGATE: Remove potential/free edges between components Merge components
The spanning tree constraint Combines the two constraints, sharing reversible variables See paper for details
An example of spanning tree constraint Hashiwokakero Puzzle • Connect the islands with bridges such that • there is a path from any island to any other island • bridges go left to right between islands (not through them) • bridges go up and down between islands (not through them) • bridges do not cross over each other • there is a maximum of 2 bridges between a pair of islands • the number of bridges from an island is the number on the island
An example of spanning tree constraint Hashiwokakero Puzzle • Connect the islands with bridges such that • there is a path from any island to any other island • bridges go left to right between islands (not through them) • bridges go up and down between islands (not through them) • bridges do not cross over each other • there is a maximum of 2 bridges between a pair of islands • the number of bridges from an island is the number on the island
An example of spanning tree constraint Hashiwokakero Puzzle Connect the islands with bridges such that … and let’s further constrain it such that there are no cycles
An example of spanning tree constraint Hashiwokakero Puzzle • Connect the islands with bridges such that … • islands are nodes • bridges are (multi) edges • spanning multi-tree • plannar (disjunctive edges) • set of disallowed edges (those that are not vertical or horizontal) • specified degree sequence
An example of spanning tree constraint An example with 88 islands/vertices
An example of spanning tree constraint Unique Solution
Conclusion • We have presented: • a rooted tree constraint • single successor model of a graph • inspired by subtour elimination constraint of Caseau & Laburthe • crude/simple connectivity constraint • adjaceny matrix model of a graph • based on disjoint sets • simple noCycle constraint • adjacency matrix model of a graph • based on disjoint sets • spanning tree constraint • adjacency matrix model of a graph • combination of connected and noCycle constraints • might be improved by using smarter connectivity constraint • (see ECAI 06 poster “A Connectivity Constraint using Bridges”)