Improving Relational Consistency Algorithms Using Dynamic Relation Partitioning � Anthony Schneider 1 Robert J. Woodward 1,2 Berthe Y. Choueiry 1 & Christian Bessiere 2 � � 1 Constraint Systems Laboratory, University of Nebraska-Lincoln � � 2 LIRMM, CNRS & University of Montpellier II � Acknowledgements � • Experiments conducted at UNL’s Holland Computing Center � • Woodward supported by a NSF Graduate Research Fellowship grant number 1041000 � • NSF Grant No. RI-111795 and EU project ICON (FP7-284715) � Constraint Systems Laboratory 9/23/14 CP 2014 1
Outline � • Introduction � – R( ∗ , m )C property and its algorithm P ER T UPLE � • Partitioning a relation � – Coarse, fine, intermediate blocks � • Improve P ER T UPLE using partitions � – P ER T UPLE → P ER FB � • Experimental results � • Conclusion � Constraint Systems Laboratory 9/23/14 CP 2014 2
� � R( ∗ , m )C (a.k.a. m -wise consistency) • A CSP is R( ∗ , m )C iff � – Every tuple in a relation can be extended � – to the variables in the scope of any ( m -1) other relations � – in an assignment satisfying all m relations simultaneously � • R( ∗ , m )C ≡ Every set of m relations is minimal � ∀ ¡tuple ¡ ..… ∀ ¡rela)on ¡ ∀ m -1 relations Constraint Systems Laboratory 9/23/14 CP 2014 3
� � P ER T UPLE [Karakashian+ AAAI 10] • P ER T UPLE enforces R( ∗ , m )C � • Store all connected combinations of m relations � � • For each relation in a combination � t i t 3 t 2 t 1 – For each tuple in the relation � – S EARCH S UPPORT : Conduct backtrack search with FC over the dual CSP � induced by the m relations � � – Remove the tuple if no solution is found � • Update propagation queue � Constraint Systems Laboratory 9/23/14 CP 2014 4
Piecewise Functional Constraints � • PW-AC enforces R( ∗ ,2)C � [Samaras & Stergiou JAIR 05] � R 1 R 2 A B C D G A B E R 1 t 1 0 0 0 0 0 0 0 0 A,B,C,D,G t 2 0 0 0 1 0 0 0 1 A,B 0 1 0 t 3 0 0 1 0 0 A,B,E A,B,F B,E,G C,F 0 1 1 t 4 0 0 1 1 1 R 2 1 0 0 t 5 0 1 1 0 1 ✗ 1 0 1 t 6 0 1 1 1 1 ✗ t 7 1 1 1 1 1 Constraint Systems Laboratory 9/23/14 CP 2014 5
Types of Partitions � R 1 : coarse blocks R 1 : fine blocks R 1 : intermediate R 1 o 1 o 2 o 3 o 1 ∪ o 2 ∪ o 3 o 1 ∪ o 3 C 2 o 1 t 1 t 1 t 1 t 1 fb 1 t 1 ib 1 t 1 cb 7 t 2 t 2 cb 4 t 2 t 2 t 2 t 2 o 1 C 3 cb 1 t 3 t 3 t 3 t 3 fb 2 t 3 ib 2 t 3 C 1 t 4 t 4 cb 5 t 4 t 4 fb 3 t 4 t 4 o 2 C 4 cb 8 t 5 t 5 t 5 t 5 fb 4 t 5 ib 3 t 5 cb 2 o 3 t 6 t 6 cb 6 t 6 t 6 t 6 t 6 C 5 t 7 cb 3 t 7 t 7 t 7 fb 5 t 7 ib 4 t 7 • For ¡each ¡rela)on, ¡we ¡store ¡ – A ¡single ¡par))on ¡of ¡fine ¡blocks ¡ – As ¡many ¡par))ons ¡of ¡coarse ¡blocks ¡as ¡shared ¡subscopes ¡ Constraint Systems Laboratory 9/23/14 CP 2014 6
P ER T UPLE → P ER FB � • Tuple → Fine Block (FB) � • General mechanism is identical � – Combinations, queuing, and propagation � • S EARCH S UPPORT � – Search enumerates fine blocks, not tuples � … – Forward checking operates on coarse blocks � • Calls to S EARCH S UPPORT reduced � – Skips tuples in the same fine blocks � – Skips fine blocks in the same intermediate block � – Using two local data structures � • Details in paper � Constraint Systems Laboratory 9/23/14 CP 2014 7
Enforcing R( ∗ , m )C with P ER FB � Vars in subscopes R 1 R 2 A B C D G R 5 A B E C F Rel Variables fb 1 t 1 0 0 0 0 0 fb 6 0 0 0 fb 20 0 0 R 1 ABC v � t 2 0 0 0 1 0 fb 7 0 0 1 fb 21 0 1 fb 2 t 3 0 0 1 0 0 fb 8 0 1 0 fb 22 1 0 fb 3 t 4 0 0 1 1 1 fb 9 0 1 1 Equiv FBs for R 1 fb 4 t 5 0 1 1 0 1 fb 10 1 0 0 A B C Consistent A B C Consistent t 5 0 1 1 1 1 fb 11 1 0 1 0 0 0 - - - True - fb 5 t 7 1 1 1 1 1 Constraint Systems Laboratory 9/23/14 CP 2014 8
Enforcing R( ∗ , m )C with P ER FB � Vars in subscopes R 1 R 2 A B C D G R 5 A B E C F Rel Variables fb 1 t 1 0 0 0 0 0 fb 6 0 0 0 fb 20 0 0 R 1 ABC t 2 0 0 0 1 0 fb 7 0 0 1 fb 21 0 1 ? fb 2 t 3 0 0 1 0 0 fb 8 0 1 0 fb 22 1 0 fb 3 t 4 0 0 1 1 1 fb 9 0 1 1 Equiv FBs for R 1 fb 4 t 5 0 1 1 0 1 fb 10 1 0 0 A B C Consistent A B C Consistent t 5 0 1 1 1 1 fb 11 1 0 1 0 0 0 0 0 0 True True fb 5 t 7 1 1 1 1 1 0 0 1 True Constraint Systems Laboratory 9/23/14 CP 2014 9
Enforcing R( ∗ , m )C with P ER FB � Vars in subscopes R 1 R 2 A B C D G R 5 A B E C F Rel Variables fb 1 t 1 0 0 0 0 0 fb 6 0 0 0 fb 20 0 0 R 1 ABC t 2 0 0 0 1 0 fb 7 0 0 1 fb 21 0 1 Yes! ? fb 2 t 3 0 0 1 0 0 fb 8 0 1 0 fb 22 1 0 fb 3 t 4 0 0 1 1 1 fb 9 0 1 1 Equiv FBs for R 1 fb 4 t 5 0 1 1 0 1 fb 10 1 0 0 A B C Consistent t 5 0 1 1 1 1 fb 11 1 0 1 0 0 0 True fb 5 t 7 1 1 1 1 1 0 0 1 True Constraint Systems Laboratory 9/23/14 CP 2014 10
Experimental Setup � • Backtrack search, find first solution, dom/deg � • Maintaining R( ∗ , m )C � [Karakashian+ AAAI 13] – Use a tree-decomposition of the CSP � – Enforce consistency on individual clusters � – Add projection of constraints to separators to bolster propagation between adjacent clusters � – Use a minimal dual graph to reduce number of combinations of m constraints � – Better performance than GAC, maxRPWC � • m = 2, 3, 4, | 𝜔 (cl)| � • XCSP benchmark of CP Solver Competition � [Lecoutre+] Constraint Systems Laboratory 9/23/14 CP 2014 11
P ER FB vs. P ER T UPLE : completed instances � 8000 8000 m=3 m=2 7000 7000 PerTuple PerTuple PerFB PerFB 6000 6000 CPU Time (s) 5000 5000 4000 4000 3000 3000 2000 2000 1000 1000 0 0 350 362 374 386 398 410 422 434 446 458 470 482 494 506 518 530 542 554 450 460 470 480 490 500 510 520 530 540 550 560 570 580 590 600 610 Number of instances completed Constraint Systems Laboratory 9/23/14 CP 2014 12
P ER FB vs. P ER T UPLE : completed instances � 8000 8000 m=| ψ (cl)| m=4 7000 7000 PerTuple PerTuple PerFB PerFB 6000 6000 CPU Time (s) 5000 5000 4000 4000 3000 3000 2000 2000 1000 1000 0 0 400 411 422 433 444 455 466 477 488 499 510 521 532 543 554 565 576 587 400 412 424 436 448 460 472 484 496 508 520 532 544 556 568 580 592 604 Number of instances completed Constraint Systems Laboratory 9/23/14 CP 2014 13
P ER FB m = 2,3,4, ¡ | 𝜔 (cl)| � 9/23/14 Constraint Systems Laboratory CPU Time (s) 1000 2000 3000 4000 5000 6000 7000 8000 0 400 404 408 412 m=4 m=2 416 420 424 428 432 436 440 444 m=| ψ (cl)| m=|C| m=3 448 452 456 Number of instances completed 460 464 468 472 476 480 484 488 PerFB 492 CP 2014 496 500 504 508 512 516 520 524 m = 2 528 532 536 540 544 548 552 556 m = 4 560 564 568 572 576 m = | 𝜔 (cl)| 580 584 588 592 m = 3 596 600 604 608 612 616 14
Detailed Results � Number of instances tested: 853 � m = 2 m = 3 m = 4 m = | 𝜔 (cl)| P ER T UPLE P ER T UPLE P ER T UPLE P ER T UPLE P ER FB P ER FB P ER FB P ER FB #Completed 546 557 604 616 566 589 597 615 … only by 5 16 1 13 2 25 8 26 … by both 541 603 564 589 Avg. CPU (sec) 538 227 521 362 472 314 669 458 S EARCH S UPPORT calls (10 9 ) 86.4 0.0 88.1 26.1 52.7 19.6 24.7 8.1 Call ratio -- 3.37 2.69 3.06 Constraint Systems Laboratory 9/23/14 CP 2014 15
Conclusions � • Contributions � – Designed P ER FB � • to replace P ER T UPLE of [Karakashian+ AAAI 10] � • by extending the work of [Samaras & Stergiou JAIR 05] � – Empirically showed benefits of our approach � • Future work � – Extend our approach to our other algorithm for enforcing R( ∗ , m )C � [Karakashian PhD 13] � � Constraint Systems Laboratory 9/23/14 CP 2014 16
Thank you for listening � Wake up the Chair! � Constraint Systems Laboratory 9/23/14 CP 2014 17
CSP: Graphical Representations � E R 4 • Hyper graph � R 2 R 1 • Dual graph � G D A B C • Minimal dual graph � R 3 F R 5 Hyper graph R 1 R 1 A,B,C,D,G A,B,C,D,G A,B A,B C A,B A,B C B,G B,G B B A,B,E A,B,F B,E,G C,F A,B,E A,B,F B,E,G C,F A,B R 3 A,B R 3 R 2 R 4 R 5 R 2 R 4 R 5 F B,E F B,E Dual graph Minimal dual graph [Janssen+,1989] Constraint Systems Laboratory 9/23/14 CP 2014 18
Block Statistics � Constraint Systems Laboratory 9/23/14 CP 2012 19
Block Statistics � Constraint Systems Laboratory 9/23/14 CP 2014 20
Partitioning Relations -- Definitions � • Scope � R 1 A,B,C,D,G • Subscope � A,B A,B C B,G • Combination � B A,B,E A,B,F B,E,G C,F A,B R 2 R 3 R 4 R 5 F B,E Constraint Systems Laboratory 9/23/14 CP 2014 21
Coarse Partitions � R 1 A B C D G R 2 A B E R 3 A B F fb 1 t 1 0 0 0 0 0 fb 6 0 0 0 fb 12 0 0 0 t 2 0 0 0 1 0 fb 7 0 0 1 fb 13 0 0 1 fb 2 t 3 0 0 1 0 0 fb 8 0 1 0 fb 14 0 1 1 fb 3 t 4 0 0 1 1 1 fb 9 0 1 1 fb 15 1 1 0 fb 4 t 5 0 1 1 0 1 fb 10 1 0 0 fb 16 1 1 1 t 5 0 1 1 1 1 fb 11 1 0 1 fb 5 t 7 1 1 1 1 1 R 1 A,B,C,D,G A,B A,B C B,G B A,B,E A,B,F B,E,G C,F A,B R 3 R 2 R 4 R 5 F B,E Constraint Systems Laboratory 9/23/14 CP 2014 22
Recommend
More recommend