Exploiting Structure in Symmetry Detection for CNF Paul T. Darga, Mark H. Liffiton, Karem A. Sakallah, and Igor L. Markov The University of Michigan.

Slides:



Advertisements
Similar presentations
Hybrid BDD and All-SAT Method for Model Checking Orna Grumberg Joint work with Assaf Schuster and Avi Yadgar Technion – Israel Institute of Technology.
Advertisements

Algorithms (and Datastructures) Lecture 3 MAS 714 part 2 Hartmut Klauck.
Time-Space Tradeoffs in Resolution: Superpolynomial Lower Bounds for Superlinear Space Chris Beck Princeton University Joint work with Paul Beame & Russell.
Presented by Monissa Mohan 1.  A highly optimized BCP algorithm  Two watched literals  Fast Backtracking  Efficient Decision Heuristic  Focused on.
Lecture 24 MAS 714 Hartmut Klauck
Graph Isomorphism Algorithms and networks. Graph Isomorphism 2 Today Graph isomorphism: definition Complexity: isomorphism completeness The refinement.
NP-Completeness: Reductions
1 Partition Into Triangles on Bounded Degree Graphs Johan M. M. van Rooij Marcel E. van Kooten Niekerk Hans L. Bodlaender.
Saucy3: Fast Symmetry Discovery in Graphs Hadi Katebi Karem A. Sakallah Igor L. Markov The University of Michigan.
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
The number of edge-disjoint transitive triples in a tournament.
Solving Difficult SAT Instances In The Presence of Symmetry Fadi A. Aloul, Arathi Ramani Igor L. Markov and Karem A. Sakallah University of Michigan.
Techniques for Proving NP-Completeness
Faster SAT and Smaller BDDs via Common Function Structure Fadi A. Aloul, Igor L. Markov, Karem A. Sakallah University of Michigan.
CPSC 322, Lecture 12Slide 1 CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12 (Textbook Chpt ) January, 29, 2010.
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
DAC Solving Difficult SAT Instances In The Presence of Symmetry Fadi A. Aloul, Arathi Ramani Igor L. Markov and Karem A. Sakallah University of Michigan.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
SubSea: An Efficient Heuristic Algorithm for Subgraph Isomorphism Vladimir Lipets Ben-Gurion University of the Negev Joint work with Prof. Ehud Gudes.
A Compressed Breadth-First Search for Satisfiability DoRon B. Motter and Igor L. Markov University of Michigan, Ann Arbor.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 24 Instructor: Paul Beame.
Shatter: Efficient Symmetry- Breaking for Boolean Satisfiability Fadi A. Aloul Igor L. Markov, Karem A. Sakallah The University of Michigan.
1 Refined Search Tree Technique for Dominating Set on Planar Graphs Jochen Alber, Hongbing Fan, Michael R. Fellows, Henning Fernau, Rolf Niedermeier, Fran.
Hardness Results for Problems
Important Problem Types and Fundamental Data Structures
Theory of Computing Lecture 19 MAS 714 Hartmut Klauck.
FAST FREQUENT FREE TREE MINING IN GRAPH DATABASES Marko Lazić 3335/2011 Department of Computer Engineering and Computer Science,
Comp 249 Programming Methodology Chapter 15 Linked Data Structure - Part B Dr. Aiman Hanna Department of Computer Science & Software Engineering Concordia.
Tractable Symmetry Breaking Using Restricted Search Trees Colva M. Roney-Dougal, Ian P. Gent, Tom Kelsey, Steve Linton Presented by: Shant Karakashian.
Fixed Parameter Complexity Algorithms and Networks.
1 Algebraic Structure in Almost-Symmetries Igor Markov, Univ. of Michigan Presented by Ian Gent, St. Andrews.
Using Symmetry to Solve Difficult Logic Puzzles Igor Markov University of Michigan, EECS.
Lecture 22 More NPC problems
Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011 TexPoint fonts used in EMF. Read the TexPoint manual before you.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
Techniques for Proving NP-Completeness Show that a special case of the problem you are interested in is NP- complete. For example: The problem of finding.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
On Finding All Minimally Unsatisfiable Subformulas Mark Liffiton and Karem Sakallah University of Michigan {liffiton, June 21, 2005.
NP-Complete problems.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
Fundamentals of Informatics Lecture 14 Intractability and NP-completeness Bas Luttik.
LIMITATIONS OF ALGORITHM POWER
Great Theoretical Ideas in Computer Science for Some.
Faster Symmetry Discovery using Sparsity of Symmetries Paul T. Darga Karem A. Sakallah Igor L. Markov The University of Michigan.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
Chapter 10 NP-Complete Problems.
Hybrid BDD and All-SAT Method for Model Checking
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Exploiting Structure in Symmetry Detection for CNF
Computability and Complexity
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness Yin Tat Lee
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
CSE 421: Introduction to Algorithms
Complexity 6-1 The Class P Complexity Andrei Bulatov.
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
Richard Anderson Lecture 25 NP-Completeness
Graphs and Algorithms (2MMD30)
NP-Completeness Yin Tat Lee
CSE 6408 Advanced Algorithms.
Switching Lemmas and Proof Complexity
Instructor: Aaron Roth
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
Complexity Theory: Foundations
Presentation transcript:

Exploiting Structure in Symmetry Detection for CNF Paul T. Darga, Mark H. Liffiton, Karem A. Sakallah, and Igor L. Markov The University of Michigan

Structure in SAT Human-designed artifacts possess considerable structure Human-designed artifacts possess considerable structure –Manifested in instances of Boolean satisfiability (SAT) Symmetry Symmetry –Some rearrangement of the components of the design that preserves its structure Sparsity Sparsity –Most design elements are directly related to only a few other elements in the whole design We can exploit this structure to speed up SAT solving! We can exploit this structure to speed up SAT solving!

 = (a'+b+c)(a+b'+c')(b'+c)(a') Symmetry Breaking Shatter (Aloul et. al) Shatter (Aloul et. al) –Converts CNF formula to a colored undirected graph (Crawford) –Uses nauty (McKay), a graph symmetry detection tool, to find the symmetries present in the graph –Converts the symmetries back into additional symmetry-breaking predicates (SBPs) –Appends the SBPs to the original formula –The resulting formula is often much faster to solve  = (a'+b+c)(a+b'+c')(b'+c) (a'+b+c) (a+b'+c') (b'+c) (a'+b+c) (a+b'+c') (b'+c) (a,a')(b,c')(b',c)

Symmetry Breaking On all but the synthetic Urquhart instances, symmetry detection with nauty dominates the run time of the Shatter flow On all but the synthetic Urquhart instances, symmetry detection with nauty dominates the run time of the Shatter flow Further improvements must come from improved symmetry detection Further improvements must come from improved symmetry detection pipe XOR ChnlRoute FPGARoute GRoute Urq Hole-n % Sym TotalSearchSymBenchmark

Outline Graph construction Graph construction nauty : "No Automorphisms, Yes?" nauty : "No Automorphisms, Yes?" –Problem description –Partition refinement –The search tree saucy : a new symmetry detection tool saucy : a new symmetry detection tool –Algorithmic improvements exploiting structure –Experimental results: saucy run time insignificant compared to SAT solver Conclusions and future work Conclusions and future work

Graph Construction for CNF Two vertices and one edge for each variable Two vertices and one edge for each variable One vertex for each clause One vertex for each clause One edge for each literal in each clause One edge for each literal in each clause Color literals and clauses differently Color literals and clauses differently b' c C3C3C3C3 c' C2C2C2C2 b C1C1C1C1 a a'  = C 1 C 2 C 3 = (a'+b+c)(a+b'+c')(b'+c)

G  = G c b' C3C3C3C3 b C1C1C1C1 c' C2C2C2C2 a' a Symmetry Detection Problem What precisely is a symmetry of a graph G? What precisely is a symmetry of a graph G? –A symmetry is a permutation  of the labels assigned to vertices of G such that G  = G –The set of all symmetries is denoted Aut(G) b' c C3C3C3C3 c' C2C2C2C2 b C1C1C1C1 a a'  = (a,a')(b,c')(b',c)(C 1,C 2 ) a b C3C3C3C3 b' C2C2C2C2 a' C1C1C1C1 c' c  = (a,b',c')(a',b,c) G  GG  GG  GG  G

Symmetry Detection Problem Problem: there are n! possible labelings! Problem: there are n! possible labelings! –Can we prune the search space?  (1,2,4) (1,2,4,3) (1,2,3,4) (1,2,3) (1,2)(3,4) (1,2) (2,4) (2,4,3) (2,3,4) (2,3) (3,4)  (1,4)(2,3)4321(1,3,2,4)3421 (1,4,2,3)4312(1,3)(2,4)3412 (1,4)4231(1,3,4)3241 (1,4,3)4213(1,3)3214 (1,4,2)4132(1,3,4,2)3142 (1,4,3,2)4123(1,3,2)

Partition Refinement We can rule out many candidate labelings We can rule out many candidate labelings –Distinguish vertices that cannot possibly be mapped into each other by any symmetry –Fast distinguishing method: degree Select a color in the graph Select a color in the graph Compute the number of connections every vertex has to that color Compute the number of connections every vertex has to that color Distinguish vertices within colors based on that count Distinguish vertices within colors based on that count Repeat until coloring stabilizes Repeat until coloring stabilizes Refinement distinguished all vertices! This graph has no symmetry besides the identity. Refinement distinguished all vertices! This graph has no symmetry besides the identity

Partition Refinement In a stable coloring: In a stable coloring: –vertices in different colors definitely cannot map into each other in some symmetry of the graph –vertices in the same color may map into each other (i.e. refinement is only an approximation) b' c C3C3C3C3 c' C2C2C2C2 b C1C1C1C1 a a'

Select a non-singleton color T (for target) and generate |T| colorings, each with one element of T artificially distinguished from the remainder of T Select a non-singleton color T (for target) and generate |T| colorings, each with one element of T artificially distinguished from the remainder of T Discrete colorings (leaf nodes) yield likely symmetries Discrete colorings (leaf nodes) yield likely symmetries Out of 6! = 720 possible labelings, partition refinement pruned away all but the six symmetries of the graph Out of 6! = 720 possible labelings, partition refinement pruned away all but the six symmetries of the graph  1 = (2,4)(3,5)  2 = (0,3)(1,2)  3 = (0,3,5)(1,2,4) The Search Tree  =  =  0 =   4 = (0,5,3)(1,4,2)  5 = (0,5)(1,4)  0 =   1 = (2,4)(3,5)  2 = (0,3)(1,2)  3 = (0,3,5)(1,2,4)  4 = (0,5,3)(1,4,2)  5 = (0,5)(1,4)

Pruning Using Generators Too many symmetries: |Aut(G)| is O(n!) Too many symmetries: |Aut(G)| is O(n!) Group theory provides the answer: generators Group theory provides the answer: generators –Irredundant set H  Aut(G) implicitly represents entire set of symmetries –Exponential compression: |H|  log 2 |Aut(G)| We prune away subtrees guaranteed to yield symmetries that we can already generate with previously discovered symmetries We prune away subtrees guaranteed to yield symmetries that we can already generate with previously discovered symmetries

saucy : Exploiting Structure nauty works very well on small graphs (and thus small formulas) but fails to scale nauty works very well on small graphs (and thus small formulas) but fails to scale –Takes considerably longer than the SAT solver after adding SBPs to the CNF formula –Runs out of memory on formulas with corresponding graphs having >50,000 vertices saucy improvement #1: sparse representation saucy improvement #1: sparse representation saucy improvement #2: use knowledge of graph construction saucy improvement #2: use knowledge of graph construction –Clause vertices only connected to their literals –Never connected to each other

saucy : Algorithmic Improvements Positive Negative Clauses nauty : nauty : –Iterate over all colors –For each vertex, count connections to refining color, and sort saucy improvement #3: saucy improvement #3: –Determine directly connected colors –For each vertex, count connections to refining color, and sort saucy improvement #4: saucy improvement #4: –For each vertex in refining color, count connections –For every color touched, sort the counts

saucy : Asymptotic Performance Partition refinement Partition refinement –nauty implementation: O(n 3 ) –saucy improvement #4: O(n 2 log n) Search tree size Search tree size –Worst case: exponential –No “bad leaves”: O(n 3 ) –In practice: O(n) Complete algorithm Complete algorithm –Worst case: exponential –No “bad leaves”: O(n 5 log n) –Much lower in practice

saucy : Empirical Performance Inst.nzChaffnauty % Sym saucy s s s s s s s s pipe pipe pipe pipe

saucy : Empirical Performance

Conclusions and Future Work CNF formulas from EDA applications exhibit considerable structure (symmetry and sparsity) CNF formulas from EDA applications exhibit considerable structure (symmetry and sparsity) saucy, a new implementation of the nauty symmetry-detection system saucy, a new implementation of the nauty symmetry-detection system –Exploits structure to improve symmetry detection performance by several orders of magnitude –Symmetry-detection time insignificant compared to SAT solver Future work Future work –Apply saucy to more sparse domains which may benefit from symmetry detection –Find other applications of partition refinement—a surprisingly general framework for distinguishing objects in a finite domain

saucy : Exploiting Structure Graphs from typical CNF formulas possess a particular structure Graphs from typical CNF formulas possess a particular structure –By construction, clauses are never connected to other clauses –Thus, when refining the partition with a color of clauses, we can ignore all colors containing clauses, since we know that the connection count for every vertex will be zero Such graphs are also very sparse Such graphs are also very sparse –Few literals are connected to most clauses –Few clauses are connected to most literals –Thus, we aggressively avoid work by maintaining data structures (like adjacency lists) which explicitly direct the search and refinement procedures

saucy : Exploiting Structure

saucy example: Hole-3

saucy : Exploiting Structure We can generalize this idea of avoiding obviously disconnected colors We can generalize this idea of avoiding obviously disconnected colors saucy improvement #3 saucy improvement #3 –Iterate over a color's adjacency lists to determine connected colors –Compute connection counts only for those colors

saucy example: Hole-3 nauty : nauty : –Iterate over all colors –For each vertex, count connections to refining color, and sort saucy improvement #3: saucy improvement #3: –Determine directly connected colors –For each vertex, count connections to refining color, and sort saucy improvement #4: saucy improvement #4: –For each vertex in refining color, count connections –For every color touched, sort the counts Positive Negative Clauses

saucy : Exploiting Structure nauty works very well on small graphs (and thus small formulas) but fails to scale nauty works very well on small graphs (and thus small formulas) but fails to scale –Takes considerably longer than the SAT solver after adding SBPs –Runs out of memory on formulas with corresponding graphs having >50,000 vertices saucy improvement #1: sparse representation saucy improvement #1: sparse representation –Input graph is represented in adjacency-list format

saucy : Exploiting Structure Graphs from CNF formulas possess a particular structure Graphs from CNF formulas possess a particular structure –Clause vertices only connected to their literals –Never connected to each other saucy improvement #2: ignore colors containing clauses when refining with clauses saucy improvement #2: ignore colors containing clauses when refining with clauses –We know that the connection count for every vertex will be zero

G  = G c b' C3C3C3C3 b C1C1C1C1 c' C2C2C2C2 a' a a b C3C3C3C3 b' C2C2C2C2 a' C1C1C1C1 c' c G  GG  GG  GG  G Symmetry Detection Problem What precisely is a symmetry of a graph G? What precisely is a symmetry of a graph G? –A symmetry is a permutation  of the labels assigned to vertices of G such that G  = G –The set of all symmetries is denoted Aut(G) b' c C3C3C3C3 c' C2C2C2C2 b C1C1C1C1 a a'  = (a,a')(b,c')(b',c)(C 1,C 2 )  = (a,c',b')(a',c,b)

The Search Tree We have a stable ordered partition  of the vertices of the graph. How can we extract Aut(G)? We have a stable ordered partition  of the vertices of the graph. How can we extract Aut(G)? Recall the naïve approach: we need labelings (i.e. discrete colorings) Recall the naïve approach: we need labelings (i.e. discrete colorings) We select a non-singleton color T (for target) and generate |T| colorings, each with one element of T individualized "in front of" the remainder of T We select a non-singleton color T (for target) and generate |T| colorings, each with one element of T individualized "in front of" the remainder of T –Partitions the set of all discrete colorings descendant from  We can then recursively apply partition refinement to further prune the search space! We can then recursively apply partition refinement to further prune the search space! Fix the first discrete coloring found as  ; the remaining discrete colorings yield likely candidates for Aut(G) Fix the first discrete coloring found as  ; the remaining discrete colorings yield likely candidates for Aut(G)

 1 = (2,4)(3,5)  2 = (0,3)(1,2)  3 = (0,3,5)(1,2,4) The Search Tree  =  =  0 =   4 = (0,5,3)(1,4,2)  5 = (0,5)(1,4) Out of 6! = 720 possible labelings, partition refinement pruned away 714, leaving the six symmetries of the graph Out of 6! = 720 possible labelings, partition refinement pruned away 714, leaving the six symmetries of the graph Discrete colorings do not necessarily yield symmetries Discrete colorings do not necessarily yield symmetries –Refinement is only an approximation –Only occurs on highly regular graphs, which are uncommon in EDA applications

saucy : Empirical Performance InstanceVerticesnauty saucy #4 SpeedupzChaffw/SBPs Urq Hole Xor timeout1.75 Fpga timeout0.03 s s s timeout s timeout s timeout s s s s timeout 2pipe pipe pipe pipe

Inst.nzChaffSBPsnauty%Symsaucy%Sym Urq % % Hole % % Xor464timeout % % Fpga671timeout %0.0125

saucy : Empirical Performance Inst.nzChaffnauty % Sym saucy s s s s s s s s pipe pipe pipe pipe

saucy : Empirical Performance Inst.nzChaffnauty % Sym saucy 2pipe pipe pipe pipe

saucy : Runtime Performance Speedup is roughly linear in the number of vertices Speedup is roughly linear in the number of vertices Primarily due to efficient use of sparsity within the partition refinement procedure Primarily due to efficient use of sparsity within the partition refinement procedure –Search tree maintenance has relatively low overhead We ran saucy and nauty on the complement graphs We ran saucy and nauty on the complement graphs –Isomorphic search trees! –Isolate performance difference in refinement Slowdown is roughly linear, which is expected given difference in representation Slowdown is roughly linear, which is expected given difference in representation

Ordered Partitions The partition refinement algorithm based on degree operates independently of the labeling of the graph The partition refinement algorithm based on degree operates independently of the labeling of the graph To guarantee identical partition representations for isomorphic graphs, we impose an ordering on the colors in the partition To guarantee identical partition representations for isomorphic graphs, we impose an ordering on the colors in the partition –When a color is split, the new colors are assigned in sorted order of degree with the refining color –Refining colors are chosen based on position within the partition ordering, not based on label The search algorithm absolutely the refinement procedure to be labeling-independent! The search algorithm absolutely the refinement procedure to be labeling-independent!

Partition Refinement In a stable coloring: In a stable coloring: –vertices in different colors definitely cannot map into each other in some symmetry of the graph –vertices in the same color may map into each other (i.e. refinement is only an approximation) b' c C3C3C3C3 c' C2C2C2C2 b C1C1C1C1 a a' Refinement can't distinguish any vertices (all have degree two) Refinement can't distinguish any vertices (all have degree two) –Vertices in the triangle and square cannot map into each other –Fortunately, this rarely happens with EDA instances An exact, polynomial time partition refinement algorithm would prove that the graph isomorphism problem is in P An exact, polynomial time partition refinement algorithm would prove that the graph isomorphism problem is in P

Additional Pruning Methods Enumerating all symmetries is not an option Enumerating all symmetries is not an option –|Aut(G)| is O(n!) –Many EDA-related instances possess exponentially many symmetries Group theory provides the answer: generators Group theory provides the answer: generators –Find a set H  Aut(G) that implicitly represents the entire set of symmetries –Every element of Aut(G) is a product (composition) of integer powers of elements of H –Exponential compression: |H|  log 2 |Aut(G)| We prune away subtrees guaranteed to yield symmetries that we can already generate with previously discovered symmetries We prune away subtrees guaranteed to yield symmetries that we can already generate with previously discovered symmetries

Symmetry Breaking On all but the synthetic Urquhart instances, symmetry detection with nauty dominates the run time of the Shatter flow On all but the synthetic Urquhart instances, symmetry detection with nauty dominates the run time of the Shatter flow Further improvements must come from improved symmetry detection Further improvements must come from improved symmetry detection BenchmarkSymSearchTotal % Sym Hole-n Urq GRoute FPGARoute ChnlRoute XOR pipe