Graphillion: ZDD-Based Compilation Tool for Graph Enumeration and - - PowerPoint PPT Presentation

graphillion zdd based compilation tool for graph
SMART_READER_LITE
LIVE PREVIEW

Graphillion: ZDD-Based Compilation Tool for Graph Enumeration and - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

Graphillion: ZDD-Based Compilation Tool for Graph Enumeration and Random Sampling Shin-ichi Minato

Kyoto University, Japan.

slide-2
SLIDE 2

“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 (0th-year) (1st-year) 2011.10 2012.4 (2nd-year) 2012.10 (3rd-year) 2013.4 (4th-year) 2013.10 2014.4 (5th-year) acceptance Scouting GLs & PDs Kick-off WS FIT2010 sympo. Fall WS Special sympo. Spring WS Fall WS Spring WS JSAI Journal Special issue Special sympo. Fall WS Spring WS FIT2013 sympo. Lab-office construction Visiting Knuth’s home Visiting CMU ALSIP 2011 Power NW Press rel. Miraikan exhibition ALSIP 2012 RM 2013 AMBN 2010 Negotiation to collab with company Fall WS “LAMP” Press rel. HU-museum exhibition Spring WS Fall WS ALSIP 2014 RC 2013 Project report 2014.10 Next Project Started

2

JSPS Basic Research Project: “Discrete Structure Manipulation System” 2015~2020, total 1M USD

2019.12.18

slide-3
SLIDE 3

Our recent activity: WEPA 2019

 The 3rd International Workshop

  • n Enumeration Problems & Applications

 held in Japan on 28-31 Oct. 2019.  Dagstuhl style WS with “Enumeration people”. 2019.12.18 3 Shin-ichi Minato -Kocoon 2019

slide-4
SLIDE 4

Our main subject

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.

Discrete structure manipulation system

design automation fault analysis constraint satisfaction problem data mining / knowledge discovery machine learning / classification bio informatics web data analysis set theory symbolic logic graph theory inductive proof combinatorics probability theory Foundational materials for C.S. and math. So many applications

 Important for the society. Performance Improvement (10–100x)

4 2019.12.18

slide-5
SLIDE 5

BDD (Binary Decision Diagram)

x

f f

(jump)

x

f f

(jump)

x

f0 f1

x x

f0 f1 (share)

x

f0 f1

x x

f0 f1 (share)

Node elimination rule Node sharing rule 1 a b c

1 1 1

1 a b c

1 1 1

5

a b b c c c c 1 1 1 1 1

BDD Binary Decision Tree

(compress)

1 1 1

(ordered)

Canonical form for given Boolean functions under a fixed variable ordering.

  • Developed in VLSI CAD area mainly in 1990’s.

2019.12.18 Shin-ichi Minato -Kocoon 2019

slide-6
SLIDE 6

Effect of BDD reduction rules O(n) O(2n)

 Exponential advantage can be seen in extreme cases.

 Depends on instances, but effective for many practical ones. 6 2019.12.18 Shin-ichi Minato -Kocoon 2019

slide-7
SLIDE 7

7

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.  Best cited paper for many years in all EE&CS areas.

BDD BDD

AND

BDD

A BDD can be constructed from the two operands of BDDs. (Computation time is almost linear for BDD size.) F G F AND G

(compressed) (compressed) (compressed)

  • R. Bryant (CMU)

2019.12.18 Shin-ichi Minato -Kocoon 2019

slide-8
SLIDE 8

Boolean functions and sets of combinations Boolean function: F = (a b ~c) V (~b c) Set of combinations: F = {ab, ac, c}

a b c F

0 0 0 0 1 0 0 0 0 1 0 0 1 1 0 1 0 0 1 1 1 0 1 1 0 1 1 0 1 1 1 0  c  ab  ac

 Operations of combinatorial itemsets

can be done by BDD-based logic

  • perations.

 Union of sets  logical OR  Intersection of sets  logical AND  Complement set  logical NOT

(customer’s choice)

8 2019.12.18 Shin-ichi Minato -Kocoon 2019

slide-9
SLIDE 9

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

f f

(jump)

x

f f

(jump)

Ordinary BDD reduction Zero-suppressed reduction

9 2019.12.18 Shin-ichi Minato -Kocoon 2019

slide-10
SLIDE 10

1 {λ}

change(c)

0 1 c

1

{c} 1 c

1

{λ, c} 1 b c

1 1

{b, bc} 0 1 a

1

{a} 1 b c

1 1

{λ, b, bc, c} 1 b c

1 1

a

1

{λ, a, b, bc, c}

change(a) union change(b) union union

ZDD construction based on set operations

2019.12.18 10 Shin-ichi Minato -Kocoon 2019

slide-11
SLIDE 11

Example: ZDD for frequent itemsets

 The results of frequent itemsets are obtained as ZDDs

  • n the main memory.
  • Freq. thres. θ = 7

{ ab, bc, a, b, c }

F

a b b c c

1

1 1 1 1 1

Record ID Tuple

1 a b c 2 a b 3 a b c 4 b c 5 a b 6 a b c 7 c 8 a b c 9 a b c 10 a b 11 b c

2019.12.18 11 Shin-ichi Minato -Kocoon 2019

“LCM-ZDD” algorithm

slide-12
SLIDE 12

Original LCM LCM-ZDDs # solutions

12

slide-13
SLIDE 13

All Freq. Itemsets

Post Processing after ZDD construction

 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. Dataset 1 Dataset 2

Frequent itemsets Frequent itemsets ZDD ZDD All Frequent Itemsets

?

ZDD algebraic

  • peration

ZDD Distinctive Frequent Itemsets

2019.12.18 13 Shin-ichi Minato -Kocoon 2019

slide-14
SLIDE 14

All Freq. Itemsets

Post Processing after ZDD construction

 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. Dataset 1 Dataset 2

Frequent itemsets Frequent itemsets ZDD ZDD All Frequent Itemsets

?

ZDD algebraic

  • peration

ZDD Distinctive Frequent Itemsets

2019.12.18 14 Shin-ichi Minato -Kocoon 2019

Knowledge compilation into ZDDs

slide-15
SLIDE 15

Graph enumeration using BDDs/ZDDs

 Enumerating subgraphs

satisfying a constraints for a given graph.

 A variable for each edge (use or not).  A path in ZDD corresponds to a subgraph.  SAT: 1-terminal, UNSAT: 0-terminal.

 For Boolean expression of constraints,

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.

15

e1 e2 e3 e4 e5 e1 e1 = 0 e2 e2 = 0 e4 e2 e2 = 1 e2 = 0 e2 = 1 e1 = 1 e5 e3 e3 e3 e3 1 s e1 t e2 e3 e4 e5

2019.12.18

slide-16
SLIDE 16

2019.12.18 Shin-ichi Minato -Kocoon 2019

“simpath” algorithm in Knuth-book

16

slide-17
SLIDE 17

26 x 26: Our record in Nov. 2013 (1404 edges included in the graph.)

2019.12.18 17

12 x 12: [Knuth 1995]

Number of paths for n x n grid graphs

19 x 19:[ B.-Melou 2009]

  • 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.

Shin-ichi Minato -Kocoon 2019

slide-18
SLIDE 18

Sketch of frontier-based algorithm

18

e1 e2 e3 e4 e5

2019.12.18

 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. e1 e1 = 0 e2 e2 = 0 e2 e2 = 1 e2 = 0 e2 = 1 e1 = 1 e3 e3 1 1 1 1

slide-19
SLIDE 19

Sketch of frontier-based algorithm

19

e1 e2 e3 e4 e5

2019.12.18

 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. e1 e1 = 0 e2 e2 = 0 e2 e2 = 1 e2 = 0 e2 = 1 e1 = 1 e3 e3 1 1 Equivalent nodes should be shared. Redundant

  • perations

can be avoided.

slide-20
SLIDE 20

Frontier Frontier

“Frontier” for ZDD node sharing

e8 e9 e10 e11 1 s e1 t e2 e4 e3 e10 e5 e6 e7 e9 e8 e11 7 6

e8

s t

e11 e9 e10 e8

s t

e11 e9 e10

e8 e9 e10 e11 1

e8

s t

e11 e9 e10

5 Done 6 connecting to 1 5 connecting to 7

20 2019.12.18

1 2 3 4 5 6 7 8 9 6 0 0 0 7 1 5 8 9

vertex mate[v]

Meaningful information 5 7 6 8 9 1 2 3 4 1

slide-21
SLIDE 21

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

slide-22
SLIDE 22

Comparison with conventional ZDD construction

 Conventional recursive algorithm:

Repeating logic/set operations between two ZDDs.

 Based on Bryant’s “Apply” algorithm

 Frontier-based method:

Direct ZDD construction by top-down & breadth-first.

 Enumerating paths/cycles, trees/forests, connected parts, etc.  Dynamic programming using a specific problem property.

(path-width)

22 2019.12.18

Frontier scan Top-down & breadth-first

slide-23
SLIDE 23

Open software: “Graphillion.org”

 Toolbox for ZDD-based graph enumeration.

 Easy interface using Python graph library.

23 2019.12.18

slide-24
SLIDE 24

Tutorial video for “Graphillion”

24 2019.12.18

slide-25
SLIDE 25

Summary: KC tool with ZDDs

 Not only enumeration but also giving an index structure.  Not only indexing but also providing rich operations.  Well-compressed structure for many practical cases.  Related to various real-life important problems.

 GIS (car navigation, railway navigation)  Dependency/Fault analysis industrial systems  Solving puzzles (Numberlink, Slitherlink, etc.)  Enumerating all possible concatenations of substrings  Control of electric power distribution networks  Layout of refuge shelters for earthquake and tsunami  Design of electoral districts for democratic fairness 2019.12.18 25 Shin-ichi Minato -Kocoon 2019