a bounded path propagator on directed graphs
play

A Bounded Path Propagator on Directed Graphs CP 16 Diego de U na, - PowerPoint PPT Presentation

A Bounded Path Propagator on Directed Graphs CP 16 Diego de U na, Graeme Gange, Peter Schachte and Peter J. Stuckey September 9, 2016 University of Melbourne CIS Department Table of Contents 1. Motivation 2. Previous work 3. Path


  1. A Bounded Path Propagator on Directed Graphs CP 16 Diego de U˜ na, Graeme Gange, Peter Schachte and Peter J. Stuckey September 9, 2016 University of Melbourne — CIS Department

  2. Table of Contents 1. Motivation 2. Previous work 3. Path propagator 4. Bounded Path propagator 5. No-good Learning 6. Experimental results Diego de U˜ na A Bounded Path Propagator on Directed Graphs CP16 2

  3. Motivation

  4. Example Problem: Task Constrained Shortest-Path Given • A weighted graph G = ( V , E , w ), a source s ∈ V and a destination d ∈ V • A set of tasks T = { t 1 , t 2 , ... } • For each vertex v , a v [ t i ] ⇔ can task t i be performed at v • An integer K Select a path p such that • p goes from s to d • The cost of p is less than K • For all the tasks in t i ∈ T , p contains at least one node v where a v [ t i ] Diego de U˜ na A Bounded Path Propagator on Directed Graphs CP16 4

  5. Example Problem: Task Constrained Shortest-Path Given • A weighted graph G = ( V , E , w ), a source s ∈ V and a destination d ∈ V • A set of tasks T = { t 1 , t 2 , ... } • For each vertex v , a v [ t i ] ⇔ can task t i be performed at v • An integer K Select a path p such that • p goes from s to d • The cost of p is less than K • For all the tasks in t i ∈ T , p contains at least one node v where a v [ t i ] Diego de U˜ na A Bounded Path Propagator on Directed Graphs CP16 5

  6. Motivation There is reasoning to be done in terms of • topology of the graph: • nodes/edges that you absolutely must visit/use • nodes/edges that you cannot visit/use • proving unfeasability • distances: • nodes that are too far • edges that are too slow • proving unfeasability We capture all this reasoning in a global: BoundedPath ( G , s , d , w ) , G , K � �� � ���� Data Variables Diego de U˜ na A Bounded Path Propagator on Directed Graphs CP16 6

  7. Previous work

  8. Previous work Other path or bounded path or related propagators: • Without learning: • Decomposition approach in CP(Graph) (Dooms et al., 2005) • First reachability propagator by (Quesada et al., 2006) • Tree/forest in (Beldiceanu et al., 2005) • Path constraint using directed trees (Fages, 2014) • With learning: • Circuit propagator (Francis et al., 2014) Diego de U˜ na A Bounded Path Propagator on Directed Graphs CP16 8

  9. Path propagator

  10. Path Propagator via trees path ( G , s , d , G ) ⇔ dtree ( G , s , G ) ∧ dtree ( G − 1 , d , G ) Global dtree ( G , r , G ) ensures that: � • G is connected ⇒ Directed Reachability from r • G is rooted at r • G is acyclic Diego de U˜ na A Bounded Path Propagator on Directed Graphs CP16 10

  11. Quick glance at Directed Reachability Find and explain dominators nodes: e 1 e 1 a r a r e 3 e 3 e 2 e 2 e 9 e 9 e 6 e 6 c c d d e 4 e 5 e 4 e 5 g g b b e 11 e 11 e 10 P e 10 e 7 e 8 e 7 e 8 t t Fig. 1 : Example of explanation for dominator d of t . (‘ ’ is the second DFS) Similar reasoning can be used to remove unreachable nodes or explain unfeasability. Also, we can find bridges. Diego de U˜ na A Bounded Path Propagator on Directed Graphs CP16 11

  12. Bounded Path propagator

  13. Prunning G ’s domain: Simple and Combined distances Simple distances: • Compute shortest path from s to all nodes • Any node further than K from s can be removed • Same reasoning on inverted graph from d Combined distances: • Compute shortest path from s , ∀ u ∈ V ⇒ δ u • Compute shortest path on G − 1 from d , ∀ u ∈ V ⇒ δ − 1 u • Any node u s.t. δ u + δ − 1 > K can be removed u • Any arc e = ( u , v ) s.t. δ u + w e + δ − 1 > K can be removed v Diego de U˜ na A Bounded Path Propagator on Directed Graphs CP16 13

  14. Prunning G ’s domain: Stronger propagation using DP We use a Dynamic Programming algorithm to compute the path from s to d visiting all the mandatory nodes M at this point. Modified Dijkstra’s algorithm: • Each u node has a table t [ m ] �→ w : cost of some path reaching u having visited m ∈ M . • Q contains tuples ( u , m , w ) procedure DPBound ( G , s , d , G , w , M ) Q ← newPriorityQueue (); Q . push (( s , { s } , 0 )); tables [ s ][ { s } ] ← 0 ⊲ One table per node while ¬ Q . empty () do ( u , m p , γ ) ← Q . top (); Q . pop () if tables [ u ] . contains ( m p ) ∧ tables [ u ][ m p ] < γ then continue; for all e = ( u , v ) ∈ { e | e ∈ E ∧ c e � = false } do if ¬ tables [ v ] . contains ( m p ) ∨ ( tables [ v ][ m p ] > γ + w [ e ]) then tables [ v ][ m p ] ← γ + w [ e ] Q . push ( v , m p ⊕ v , γ + w [ e ]) ⊲ S ⊕ v adds v to set S iff v ∈ M return tables [ d ][ M ] Diego de U˜ na A Bounded Path Propagator on Directed Graphs CP16 14

  15. Dealing with state explosion Dynamic Programming algorithm is exponential in | M | ! In practice behaves very well: the higher | M | the less choices of edges there are in the tree ⇒ we rarely see any state explosion . Ways of preventing state explosion: • Node clustering: only enforce the visit of x centroids • SCCs: topological sort of SCCs, do not leave SCCs unless finished. 1 3 5 S A B 2 4 6 C E D Diego de U˜ na A Bounded Path Propagator on Directed Graphs CP16 15

  16. No-good Learning

  17. Naive explanations Quickly computed, trivial explanation can be obtained as follows: 1. Compute shortest path from s , ∀ u ∈ V ⇒ δ u 2. Compute shortest path on G − 1 from d , ∀ u ∈ V ⇒ δ − 1 u 3. Add all arcs e = ( u , v ) s.t. δ u + w e + δ − 1 ≤ K to F n v Explanation when removing a “too-distant” node n : � � δ d ≤ K � ∧ ¬ c e f ⇒ ¬ c n e f ∈ F n • Same explanation for combined distances propagation • Easily adapted to DP: add conjunction of mandatory nodes Diego de U˜ na A Bounded Path Propagator on Directed Graphs CP16 17

  18. Minimal explanations for Simple and Combined Distances Explaining why some node n is “too far” from s: 1. Compute shortest path from s to all nodes 2. Starting at n , compute shortest path in reversed graph allowing the use of forbidden edges . 3. Add forbidden edges that yield a path shorter than K to set X . Minimal explanation when removing a “too-distant” node n : � � δ d ≤ K � ∧ ¬ c e f ⇒ ¬ c n e f ∈ X We can adapt this to Combined distances by combining partial explanations. Diego de U˜ na A Bounded Path Propagator on Directed Graphs CP16 18

  19. Example We want a path no longer than 10 (K = 10) But the shortest path is 18! 12 16 c e 10 2 2 2 2 2 2 s a n b e 1 e 2 0 2 14 18 Diego de U˜ na A Bounded Path Propagator on Directed Graphs CP16 19

  20. Example We want a path no longer than 10 (K = 10) But the shortest path is 18! 12 16 c e 10 2 2 2 2 2 2 s a n b e 1 e 2 0 2 14 18 0 Diego de U˜ na A Bounded Path Propagator on Directed Graphs CP16 20

  21. Example We want a path no longer than 10 (K = 10) But the shortest path is 18! 12 16 2 c e 10 2 2 2 2 2 2 s a n b e 1 e 2 0 2 14 18 0 Diego de U˜ na A Bounded Path Propagator on Directed Graphs CP16 21

  22. Example We want a path no longer than 10 (K = 10) But the shortest path is 18! 12 16 2 c e 10 2 2 2 2 2 2 s a n b e 1 e 2 0 2 14 2 18 0 e 2 : 14 + 2 + 0 = 16 > K ⇒ cross it. Diego de U˜ na A Bounded Path Propagator on Directed Graphs CP16 22

  23. Example We want a path no longer than 10 (K = 10) But the shortest path is 18! 12 16 2 c e 10 2 2 2 2 2 2 s a n b e 1 e 2 0 2 14 14 2 18 0 e 1 : 2 + 2 + 2 = 6 ≤ K ⇒ explanation . Diego de U˜ na A Bounded Path Propagator on Directed Graphs CP16 23

  24. Better explanations for the DP algorithm Explaining that there is no path containing M of cost less than K 1. Run the DPBound algorithm 2. Starting at d , run DPBound in the reversed graph allowing the use of forbidden edges . 3. Forbidden edges that yield a path shorter than K containing all the nodes in M explain the inference. ⇒ lookup tables to see if all nodes are visited. State explosion Because we allow the use of forbidden edges, state explosion can happen more frequently. Avoid it by switching to naive explanations if the algorithm is too slow Diego de U˜ na A Bounded Path Propagator on Directed Graphs CP16 24

  25. Experimental results

  26. Experimental results: Task Constrained Shortest Path Expl * (all use smallest ) Expl NoExpl Version Conflicts Nodes Time(s) Opt(s) Conflicts Nodes Time(s) Opt(s) Conflicts Nodes Time(s) Opt(s) Circuit 48790 54254 3.18 2.14 48790 54254 3.18 2.14 308888 619304 7.95 6.48 Circuit + BPath 18303 19883 2.90 1.49 27050 29995 3.70 2.84 174329 350327 15.99 13.67 Circuit + DPBPath 636 1133 2.09 1.86 4933 6228 1.68 1.36 31256 188278 4.47 3.75 Path 26488 28801 7.05 2.27 26488 28801 7.05 2.27 200773 402943 32.63 9.81 Path + BPath 13175 14787 3.63 1.30 15238 16868 4.07 1.37 76701 156208 16.20 5.51 Path + DPBPath 54 456 0.53 0.36 221 648 1.31 0.44 381 1253 2.96 1.14 Table 1: Benefit from BPath & DPBPath with both Path and Circuit . Average over 500 instances of 20 nodes. Diego de U˜ na A Bounded Path Propagator on Directed Graphs CP16 26

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend