Graphillion: ZDD-Based Compilation Tool for Graph Enumeration and Random Sampling Shin-ichi Minato Kyoto University, Japan.
“ERATO” project and after Top projects of scientific research in Japan. Executed by JST (Japan Science and Technology Agency). 5 projects / Year are accepted from all scientific subjects. (Computer Science: 0 or 1 project / Year.) 5 year project, total fund: ~10M USD. about 10 PD researchers and 3 admin staffs. 2009.10 2010.4 2010.10 2011.4 2011.10 2012.4 JSPS Basic Research Project: 2012.10 2013.4 2013.10 2014.4 2014.10 “Discrete Structure Manipulation System” (4th-year) (5th-year) (0th-year) (1st-year) (2nd-year) (3rd-year) 2015 ~ 2020, total 1M USD acceptance Fall Spring Spring Fall Spring Fall Fall Kick-off Fall Spring WS WS WS WS WS WS WS WS WS WS JSAI Journal Scouting FIT2010 Special Special Project FIT2013 Next Special issue GLs & PDs sympo. sympo. sympo. report RC sympo. Project Miraikan 2013 HU-museum Visiting AMBN Started exhibition exhibition Knuth’s 2010 ALSIP Visiting RM ALSIP Lab-office ALSIP 2011 Power NW home “LAMP” CMU 2013 2014 construction 2012 Press rel. Negotiation to Press rel. collab with company 2019.12.18 2
Our recent activity: WEPA 2019 The 3rd International Workshop on Enumeration Problems & Applications held in Japan on 28-31 Oct. 2019. Dagstuhl style WS with “Enumeration people”. 2019.12.18 Shin-ichi Minato -Kocoon 2019 3
Discrete structures and applications Many problems solved by computers can be decomposed as a type of discrete structures using simple primitive operations. Often needs a huge amount of enumerative operations . design automation data mining / knowledge discovery So many applications machine learning / classification fault analysis bio informatics Important web data analysis constraint satisfaction problem for the society. Our main Performance subject Improvement Discrete structure (10–100x) manipulation system Foundational inductive proof symbolic logic set theory materials for C.S. and math. probability theory graph theory combinatorics 2019.12.18 4
BDD (Binary Decision Diagram) - Developed in VLSI CAD area mainly in 1990’s. x x (jump) (jump) (ordered) Binary Decision Tree BDD a a f f f f a 1 1 (compress) 0 1 0 0 Node elimination rule b b b b 0 0 1 0 0 1 1 1 c c (share) (share) c c 0 0 c c x x x x x x 1 1 0 0 1 1 1 0 1 0 1 0 1 1 f 0 f 0 f 1 f 1 f 1 f 1 f 0 f 0 Canonical form for given Boolean functions under a fixed variable ordering. Node sharing rule 2019.12.18 Shin-ichi Minato -Kocoon 2019 5
Effect of BDD reduction rules Exponential advantage can be seen in extreme cases. Depends on instances, but effective for many practical ones. O( n ) O(2 n ) 2019.12.18 Shin-ichi Minato -Kocoon 2019 6
BDD-based logic operation algorithm If the BDD starting from the binary tree: always requires exponential time & space. Innovative BDD synthesis algorithm Proposed by R. Bryant in 1986. R. Bryant (CMU) Best cited paper for many years in all EE&CS areas. F F AND G AND (compressed) BDD (compressed) BDD G (compressed) BDD A BDD can be constructed from the two operands of BDDs. (Computation time is almost linear for BDD size.) 2019.12.18 Shin-ichi Minato -Kocoon 2019 7
Boolean functions and sets of combinations Boolean function: a b c F F = ( a b ~ c ) V (~ b c ) 0 0 0 0 Set of combinations: 1 0 0 0 F = { ab , ac , c } 0 1 0 0 ab 1 1 0 1 (customer’s choice) c Operations of combinatorial itemsets 0 0 1 1 can be done by BDD-based logic ac 1 0 1 1 operations. 0 1 1 0 Union of sets logical OR Intersection of sets logical AND 1 1 1 0 Complement set logical NOT 2019.12.18 Shin-ichi Minato -Kocoon 2019 8
Zero-suppressed BDD (ZDD) [Minato93] A variant of BDDs for sets of combinations. Uses a new reduction rule different from ordinary BDDs. Eliminate all nodes whose “1-edge” directly points to 0-terminal. Share equivalent nodes as well as ordinary BDDs. If an item x does not appear in any itemset, the ZDD node of x is automatically eliminated. When average occurence ratio of each item is 1%, ZDDs are more compact than ordinary BDDs, up to 100 times. x x (jump) (jump) 0 f f f f Zero-suppressed reduction Ordinary BDD reduction 2019.12.18 Shin-ichi Minato -Kocoon 2019 9
ZDD construction based on set operations { b , bc } { c } b {λ, b , bc, c } 1 c 0 1 change( b ) 0 c {λ, a , b , bc, c } 0 1 b {λ, c } 0 1 0 1 0 1 a c c union 0 1 0 1 0 1 change( c ) union b { a } 1 1 1 0 {λ} union c a 1 0 change( a ) 0 1 1 1 0 1 2019.12.18 Shin-ichi Minato -Kocoon 2019 10
Example: ZDD for frequent itemsets The results of frequent itemsets are obtained as ZDDs on the main memory. Record Tuple ID F 1 a b c 2 a b “ LCM-ZDD” a 3 a b c 0 1 algorithm 4 b c 5 a b b b Freq. thres. θ = 7 0 1 6 a b c 0 1 7 c { ab, bc, a, b, c } c c 1 8 a b c 1 0 0 9 a b c 10 a b 0 1 11 b c 2019.12.18 Shin-ichi Minato -Kocoon 2019 11
LCM-ZDDs Original LCM # solutions 12
Post Processing after ZDD construction Frequent itemsets Dataset 1 ? ZDD ZDD Frequent ZDD algebraic itemsets operation Dataset 2 ZDD Distinctive Frequent All Freq. All Frequent Itemsets Itemsets Itemsets We can extract distinctive itemsets by comparing frequent itemsets for multiple sets of databases. Various ZDD algebraic operations can be used for the comparison of the huge number of frequent itemsets. 2019.12.18 Shin-ichi Minato -Kocoon 2019 13
Post Processing after ZDD construction Frequent itemsets Dataset 1 ? ZDD ZDD Frequent ZDD algebraic itemsets operation Dataset 2 ZDD Distinctive Frequent All Freq. All Frequent Itemsets Itemsets Itemsets Knowledge compilation We can extract distinctive itemsets by comparing into ZDDs frequent itemsets for multiple sets of databases. Various ZDD algebraic operations can be used for the comparison of the huge number of frequent itemsets. 2019.12.18 Shin-ichi Minato -Kocoon 2019 14
Graph enumeration using BDDs/ZDDs e 1 e 1 = 1 e 1 = 0 e 1 e 4 e 2 e 2 e 2 = 0 e 3 e 2 = 1 e 2 = 1 e 2 = 0 e 3 e 3 e 3 e 3 e 2 e 5 1 0 e 4 Enumerating subgraphs e 5 satisfying a constraints for a given graph. A variable for each edge (use or not). s e 1 e 4 A path in ZDD corresponds to a subgraph. t e 3 SAT: 1-terminal, UNSAT: 0-terminal. For Boolean expression of constraints, e 2 e 5 a set of subgraph can be a BDD/ZDD . Well-compressed if there are many similar subgraphs. ZDD is better than BDD if using an edge disables another one. 2019.12.18 15
“simpath” algorithm in Knuth-book 16 2019.12.18 Shin-ichi Minato -Kocoon 2019
Number of paths for n x n grid graphs 12 x 12: [Knuth 1995] 19 x 19:[ B.-Melou 2009] 26 x 26: Our record in Nov. 2013 (1404 edges included in the graph.) - up to 18 × 18, we can construct a ZDD to keep all solutions. - from 19 × 19, we just count the number of solutions. - from 22 × 22, we only consider the n × n grid graphs. 2019.12.18 Shin-ichi Minato -Kocoon 2019 17
Sketch of frontier-based algorithm e 1 e 1 e 1 = 1 e 4 e 1 = 0 e 2 e 2 e 3 e 2 = 0 e 2 = 1 e 2 = 1 e 2 = 0 e 2 e 5 e 3 e 3 0 0 1 1 1 1 From upper-ordered edges, by case-splitting by using or not, a binary decision tree is constructed. Terminate to “0” if constraint-violation found during the process. Terminate to “1” if constraint-satisfied after all decisions. 2019.12.18 18
Sketch of frontier-based algorithm e 1 e 1 e 1 = 1 e 4 e 1 = 0 e 2 e 2 e 3 e 2 = 0 e 2 = 1 e 2 = 1 e 2 = 0 e 2 e 5 e 3 e 3 0 0 Equivalent nodes Redundant should be shared. operations can be avoided. 1 1 From upper-ordered edges, by case-splitting by using or not, a binary decision tree is constructed. Terminate to “0” if constraint-violation found during the process. Terminate to “1” if constraint-satisfied after all decisions. 2019.12.18 19
e 8 “Frontier” for ZDD node sharing 5 t s e 10 1 e 4 5 e 8 7 e 11 s e 1 e 6 2 Frontier 9 4 t 6 e 3 e 10 Done e 9 1 e 7 7 e 2 e 11 e 8 e 8 t 3 t 8 s s e 5 e 10 e 10 e 9 6 e 11 e 11 e 9 e 9 6 connecting to 1 5 connecting to 7 e 8 e 8 Frontier e 9 e 9 0 0 vertex 1 2 3 4 5 6 7 8 9 e 10 e 10 0 0 mate[v] 6 0 0 0 7 1 5 8 9 e 11 e 11 0 0 Meaningful information 0 1 0 1 20 2019.12.18
Frontier-based method (generalization of simpath) Variation of s-t path problem s-t paths Hamilton paths (exercise in Knuth-book) paths cycles (also in Knuth-book) Non-directed graphs directed graphs Multiple s-t pairs (non crossing routing problem) Other various graph enumeration problems Subtrees / spanning trees, forests, cutsets, k-partitions, connection probability, (perfect) matching, etc. Generating BDDs for Tutte polynomials (graph invariant) We found that Sekine-Imai’s idea in 1995 was in principle similar to Knuth simpath algorithm. They used BDDs instead of ZDDs. Enumerating connective subgraphs, not paths. 2019.12.18 21
Recommend
More recommend