Random Generation and Enumeration of Bipartite Permutation Graphs Toshiki Saitoh (JAIST, Japan) Yota Otachi (Gunma Univ., Japan) Katsuhisa Yamanaka (UEC, Japan) Ryuhei Uehara (JAIST, Japan) 1 ○
Motivation Input graphs Interval graphs Permutation graphs Computer experiment Input Output Proper interval graphs Bipartite permutation graphs [Saitoh et al. 09] Random generation Enumeration We want suitable test data … Enumerate all object Generate an object uniformly at random 2
Our Algorithms Random Generation of connected bipartite permutation graphs Input : natural number n Output : a connected bipartite permutation graph with n vertices An output graph is chosen uniformly at random (the graph is non-labeled) Based on counting of the graphs The number of operation: O(n) Enumeration of connected bipartite permutation graphs Input : natural number n Output : all connected bipartite permutation graphs with n vertices Without duplications ( graphs are non-labeled ) Based on the reverse search [Avis, Fukuda, 96] Running time: O(1) time / graph 3
Permutation Graphs A graph is called a permutation graph if the graph has a line representation Line representation Permutation Graph (also, permutation diagraph) 4
Bipartite Permutation Graphs A permutation graph is called a bipartite permutation graph if the graph is bipartite Bipartite permutation graph Line representation Random generation and enumeration of bipartite permutation graphs 5 : vertices in a set Y : vertices in a set X
Useful Property of Connected Bipartite Permutation Graphs Bipartite permutation graph Line representation Line representation (0, 0) 0 Dyck path 6 Lemma 1 In a line representation Blue line (corresponds to a vertex in X): from upper left to lower right Red line (corresponds to a vertex in Y): from upper right to lower left Any two lines with the same color have no intersection 0-1 binary string Dyck path
How to Construct Dyck Path from 0-1 Binary String (0, 0) 0 7 Sweep the two lines alternately ‘1’ ⇒ go right and go up ‘0’ ⇒ go right and go down For each character,
Bipartite Permutation Graph with n Vertices Property of Dyck path The last coordinate is (2n, 0) The upper / lower lines have n ‘1’s and n ‘0’s Located on the upper side of x-axis The points on x-axis are boundaries of connected component of the graph (0, 0) (2n, 0) 8 A (non-connected) graph line rep. Dyck path
Connected Bipartite Permutation Graph with n Vertices y = y = 1 9 Property of Dyck path The last coordinate is (2n, 0) The upper / lower lines have n ‘1’s and n ‘0’s Located on the upper side of x-axis For all points except (0,0) and (2n,0), its value of y-coordinate is equal or greater than 1 A graph line rep. Dyck path
Connected Bipartite Permutation Graph with n Vertices y = 1 10 Property of Dyck path The last coordinate is (2n, 0) The upper / lower lines have n ‘1’s and n ‘0’s Located on the upper side of x-axis For all points except (0,0) and (2n,0), its value of y-coordinate is equal or greater than 1 A graph line rep. Dyck path For random generation, it is sufficient to generate a Dyck path randomly? No
One line rep. Two line reps. The Reason of “No” There is no 1 to 1 correspondence between connected bipartite permutation graphs and their line representations 11 A graph corresponds to at most four line representations Four line reps. Examples
Equivalent Line Representations horizontal- flip Vertical- flip horizontal- flip Vertical- flip Rotation This graph corresponds to four line representations Lemma 2 There exists at most four line representations for any connected bipartite permutation graph
horizontal- symmetric Vertical- flip horizontal- flip horizontal- symmetric 13 Equivalent Line Representations Lemma 2 There exists at most four line representations for any connected bipartite permutation graph This graph corresponds to two line representations
Rotational-symmetric line representation Vertical-symmetric line representation 14 Corresponding graphs have two line representations resp. Other examples: Equivalent Line Representations Lemma 2 There exists at most four line representations for any connected bipartite permutation graph
1 to 1 Bipartite Permutation Graph Horizontal, vertical, rotational-symmetric line representation 15 Equivalent Line Representations Lemma 2 There exists at most four line representations for any connected bipartite permutation graph This graph have one line representation
Generate a Line Representation Randomly A set of line representations Horizontal- symmetric Vertical- symmetric Rotational- symmetric If we generate a line representation randomly, A graph corresponding to four line reps. is frequently generated H-, V-, R- symmetric 16 H, V, R-symmetric: Horizontal-, Vertical-, Rotational- symmetric
Horizontal- symmetric To avoid such problem, decrease the probability to generate graphs corresponding to two or four line reps.? generate only canonical forms ? These methods seem not to work … 17 A set of line representations Vertical- symmetric Rotational- symmetric H-, V-, R- symmetric Generate a Line Representation Randomly
Our Approach: Normalization of Probability Any graph corresponds to the four line representations Horizontal- symmetric H-, V-, R- symmetric Rotational- symmetric H-, V-, R- symmetric Vertical- symmetric Counting groups Our random generation: 1. Choose one among 4 groups 2. Randomly generate the chosen one 18 A set of line representations Horizontal- symmetric Rotational- symmetric Vertical- symmetric H-, V-, R- symmetric
Counting All Line Representations The number of Dyck paths of length 2n – 2 = C(n-1) y = 0 y = 1 19 All line representations Catalan number: Dyck paths of length 2n – 2 correspondence A line representations
Counting Rotational-symmetric Line Representations A rotational-symmetric line reps. y = 1 The number of symmetric Dyck paths of length 2n – 2 20 Rotational-symmetric line reps. Symmetric Dyck paths of length 2n – 2 correspondence
Counting Vertical-symmetric Line Representations Vertical-symmetric line reps y = 1 The number of Dyck paths of length n – 2 = C(n/2-1) 21 Vertical-symmetric line reps. Dyck paths of length n – 2 correspondence The upper string is identical to the lower one Catalan number:
Counting Horizontal-symmetric Line Representations Rotational-symmetric line reps horizontal-symmetric line reps. y = 1 22 Horizontal-symmetric line reps. Rotational-symmetric line reps. (2-Motzkin path) correspondence H-symmetric line reps. R-symmetric line reps. The number of ==
Horizontal- symmetric H-, V-, R- symmetric Rotational- symmetric H-, V-, R- symmetric Vertical- symmetric A set of line representations Horizontal- symmetric Rotational- symmetric Vertical- symmetric H-, V-, R- symmetric Random Generation Our random generation: 1. Choose one among 4 groups 2. Randomly generate the chosen one O(n) operations O(n) space See: [Saitoh et al. 2009] 23
Conclusions and Future Works 24 For bipartite permutation graphs, we have designed the following two algorithms Random generation algorithm: O(n+m) time Enumeration algorithm: O(1) time / graph Random generation and enumeration of permutation graphs Random generation and enumeration of interval graphs Conclusions Future works