Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Fast Algorithm for Enumerating Bipartite Perfect Matchings Takeaki Uno (National Institute of Informatics, JAPAN)

Similar presentations


Presentation on theme: "A Fast Algorithm for Enumerating Bipartite Perfect Matchings Takeaki Uno (National Institute of Informatics, JAPAN)"— Presentation transcript:

1 A Fast Algorithm for Enumerating Bipartite Perfect Matchings Takeaki Uno (National Institute of Informatics, JAPAN)

2 Motivations Goal: find out general techniques and properties for speed up enumeration algorithms Speeding up discrete algorithms. A lot of studies have been done. Enumeration algorithms: Algorithms have been proposed for various problems. Speeding up enumeration algorithm: Only few studies have been done. Optimization => find a solution Enumeration => find many solutions Techniques, structures, and analysis do not work well. Original techniques for enumeration algorithms are required

3 Enumeration Problem of Bipartite Perfect Matchings For a given bipartite graph G = (V, E), output all the perfect matchings included in G per matching Matsui, Fukuda (’93) O(|E|) I (’97) O(|V|) (amortized analysis) Minimum weighted perfect matchings Matsui, Fukuda O(|E||V|) I (’01: submitting) O(|V|) This talk: O( log |V|) ( both )

4 Partition the problem into two subproblems, and solve the subproblems recursively 1. Choose a vertex v 2. E 1, E 2 = Partition of edges incident to v 3. Solve two subproblems: enumeration of perfect matchings including an edge of E i for i = 1,2 Subproblem of E 1 = problem of ( V, E \ E 2 ) Simple Algorithm E1E1 E2E2 v

5 To partition the problem, subproblem of ( V, E \ E i ) has to include at least one perfect matching For a perfect matching M and a vertex v 1. Find a perfect matching M’ ≠ M 2. E 1, E 2 = Partition of edges incident to v such that E 1 includes an edge of M E 2 includes an edge of M’ Simple Algorithm 2 M M’ v How to find M’ ? E1E1 E2E2 # iter ≤ 2 # perfect matchings

6 Use a directed graph DG( G, M ) · Orient edges of M in a direction · Orient other edges in the opposite direction A perfect matching M‘ exists  a directed cycle is in DG( G, M ) M‘ is obtained by exchanging edges along the cycle Finding M’ from M M Operation of an iteration = Finding a directed cycle = O( |E|)

7 Consider speeding up an iteration · Really take O( |E| ) time? --- in worst case, really take · Dynamic graph approach --- maintain directed cycle Similar to transitivity update, O( |V| 2 ) · Amortized analysis --- distribute time to subproblems A graph including a perfect matching requires O( |V| 2 ) time Difficulty of Speed up Needs of · improve algorithms · improve amortized analysis

8 “Trimming and balancing“ generalized technique for speeding up Proposed 3 years ago ( by I ) : Isaac98 · Time complexity analysis and speeding up using the analysis, specialized for enumeration algorithms · Improved several algorithms, which had not been improved by existing techniques

9 Corollary of “Trimming and balancing“ For an iteration x of an (recursive type) enumeration algorithm, T(x) : computation time for x Chd(x) : Children of x T* : amortized computation time for an iteration T l : maximum computation time of bottom level iterations If for a constant α >1, for any x, α T(x) - α ≤ ∑ T(y) => T* = O ( T l ) y ∈ Chd(x) If for a constant α > 1, for any x and its child y, αT(y) + α ≥ T(x) => T* = O ( T l × log ( input size ) ) ( we use this here)

10 “Trimming and balancing“ Trimming and balancing improves algorithms by adding trimming phase and balancing phase to each iteration Simple algorithm · satisfies no these conditions · T l = O(|E|) For each iteration, add “trimming phase” to decrease T l → O( 1 ) add “balancing phase” to satisfy T(x)-2 ≤ 4T(y)

11 Trimming Phase Pass reduced graphs to subproblems Remove edges · included in all perfect matchings · included in no perfect matching → included in no directed cycle Contract 3 consecutive edges into an edge Take O(|E|) time Reduce to an equivalent problem On bottom level input graph includes one perfect matching → O(1) size graph → T l = O( 1 )

12 Trimming Phase 2 Lemma For a trimmed graph G = (V, E) a perfect matching M, DG(G, M) includes at least f(G) = |E| - |V| +cc(G) directed cycles (cc(G) : # of connected components of G ) In a trimmed graph G = (V, E) |E| ≥ 1.25|V| → |E| - |V| ≥ 0.2|E| → G = (V, E) includes at least 0.2|E| perfect matchings → T l = O( 1 )

13 Balancing Phase Set E 1, E 2 in arbitrary way If ( V, E \ E i ) has few edges after trimming phase, re-choose E 1, E 2 f(G) = |E| - |V| + ( # of connected components of G ) → ( V, E \ E i ) can includes few edges but 4 f( ( V, E \ E i ) ) + 2 ≥ f(G)

14 Re-choose edge sets If ( V, E \ E i ) has few edges after trimming phase then DG(G, M) includes many edges included in only directed cycles including edges of E i E1E1 E2E2 Take O(|E|) time EiEi

15 Analysis An iteration inputting G=( V, E ) takes O(|V|+|E|) = O( f(G) ) time On bottom level, O(|V|+|E|) = O( f(G) ) = O(1) → T l = O( 1 ) From balancing phase, 4 f( (V, E \ E i ) ) + 4 ≥ f(G) From Theorem, time complexity = O( 1 × log n (=log m) ) per perfect matching

16 Conclusion Speeded up enumeration algorithm of perfect matchings, using “trimming and balancing”


Download ppt "A Fast Algorithm for Enumerating Bipartite Perfect Matchings Takeaki Uno (National Institute of Informatics, JAPAN)"

Similar presentations


Ads by Google