Speeding Up Enumeration Algorithms with Amortized Analysis Takeaki Uno (National Institute of Informatics, JAPAN)

Slides:



Advertisements
Similar presentations
Chapter 5: Tree Constructions
Advertisements

CSC 421: Algorithm Design & Analysis
More Efficient Generation of Plane Triangulations Shin-ichi Nakano Takeaki Uno Gunma University National Institute of JAPAN Informatics, JAPAN 23/Sep/2003.
Graph Isomorphism Algorithms and networks. Graph Isomorphism 2 Today Graph isomorphism: definition Complexity: isomorphism completeness The refinement.
LCM: An Efficient Algorithm for Enumerating Frequent Closed Item Sets L inear time C losed itemset M iner Takeaki Uno Tatsuya Asai Hiroaki Arimura Yuzo.
© The McGraw-Hill Companies, Inc., Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
Deterministic Selection and Sorting Prepared by John Reif, Ph.D. Analysis of Algorithms.
Lectures on Network Flows
Heapsort By: Steven Huang. What is a Heapsort? Heapsort is a comparison-based sorting algorithm to create a sorted array (or list) Part of the selection.
On the Enumeration of Bipartite Minimum Edge Colorings Yasuko Matsui (Tokai Univ. JAPAN) Takeaki Uno (National Institute of Informatics, JAPAN)
Advanced Topics in Algorithms and Data Structures 1 Rooting a tree For doing any tree computation, we need to know the parent p ( v ) for each node v.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
1 Introduction to Linear and Integer Programming Lecture 9: Feb 14.
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
A general approximation technique for constrained forest problems Michael X. Goemans & David P. Williamson Presented by: Yonatan Elhanani & Yuval Cohen.
Course Review COMP171 Spring Hashing / Slide 2 Elementary Data Structures * Linked lists n Types: singular, doubly, circular n Operations: insert,
CSE 421 Algorithms Richard Anderson Lecture 4. What does it mean for an algorithm to be efficient?
2-Layer Crossing Minimisation Johan van Rooij. Overview Problem definitions NP-Hardness proof Heuristics & Performance Practical Computation One layer:
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
Randomness in Computation and Communication Part 1: Randomized algorithms Lap Chi Lau CSE CUHK.
The Complexity of Algorithms and the Lower Bounds of Problems
Packing Element-Disjoint Steiner Trees Mohammad R. Salavatipour Department of Computing Science University of Alberta Joint with Joseph Cheriyan Department.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Mining Frequent Itemsets with Constraints Takeaki Uno Takeaki Uno National Institute of Informatics, JAPAN Nov/2005 FJWCP.
Algorithms for Enumerating All Spanning Trees of Undirected and Weighted Graphs Presented by R 李孟哲 R 陳翰霖 R 張仕明 Sanjiv Kapoor and.
A Fast Algorithm for Enumerating Bipartite Perfect Matchings Takeaki Uno (National Institute of Informatics, JAPAN)
Fixed Parameter Complexity Algorithms and Networks.
I/O-Efficient Graph Algorithms Norbert Zeh Duke University EEF Summer School on Massive Data Sets Århus, Denmark June 26 – July 1, 2002.
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
2IL05 Data Structures Fall 2007 Lecture 13: Minimum Spanning Trees.
Spring 2015 Lecture 11: Minimum Spanning Trees
Toward Constant time Enumeration by Amortized Analysis 27/Aug/2015 Lorentz Workshop for Enumeration Algorithms Using Structures Takeaki Uno (National Institute.
Algorithms  Al-Khwarizmi, arab mathematician, 8 th century  Wrote a book: al-kitab… from which the word Algebra comes  Oldest algorithm: Euclidian algorithm.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Computer Algorithms Submitted by: Rishi Jethwa Suvarna Angal.
An Efficient Algorithm for Enumerating Pseudo Cliques Dec/18/2007 ISAAC, Sendai Takeaki Uno National Institute of Informatics & The Graduate University.
An Efficient Polynomial Delay Algorithm for Pseudo Frequent Itemset Mining 2/Oct/2007 Discovery Science 2007 Takeaki Uno (National Institute of Informatics)
LCM ver.3: Collaboration of Array, Bitmap and Prefix Tree for Frequent Itemset Mining Takeaki Uno Masashi Kiyomi Hiroki Arimura National Institute of Informatics,
New Algorithms for Enumerating All Maximal Cliques
CSE 340: Review (at last!) Measuring The Complexity Complexity is a function of the size of the input O() Ω() Θ() Complexity Analysis “same order” Order.
Chapter 11. Chapter Summary  Introduction to trees (11.1)  Application of trees (11.2)  Tree traversal (11.3)  Spanning trees (11.4)
Proof of correctness of Dijkstra’s algorithm: Basically, we need to prove two claims. (1)Let S be the set of vertices for which the shortest path from.
Code: BCA302 Data Structures with C Prof. (Dr.) Monalisa Banerjee By.
CSE 373, Copyright S. Tanimoto, 2001 Up-trees - 1 Up-Trees Review of the UNION-FIND ADT Straight implementation with Up-Trees Path compression Worst-case.
CMPT 438 Algorithms.
Applied Discrete Mathematics Week 15: Trees
Randomized Min-Cut Algorithm
CSC 421: Algorithm Design & Analysis
CSC 421: Algorithm Design & Analysis
Introduction to Algorithms
CSE 373, Copyright S. Tanimoto, 2001 Up-trees -
CSC 421: Algorithm Design & Analysis
Minimum Spanning Tree 8/7/2018 4:26 AM
12. Graphs and Trees 2 Summary
Introduction to Trees Section 11.1.
Lectures on Network Flows
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 10 Trees Slides are adopted from “Discrete.
The Complexity of Algorithms and the Lower Bounds of Problems
Bart M. P. Jansen June 3rd 2016, Algorithms for Optimization Problems
Elementary graph algorithms Chapter 22
CSE373: Data Structures & Algorithms Lecture 5: AVL Trees
Output Sensitive Enumeration
Output Sensitive Enumeration
CSC 421: Algorithm Design & Analysis
And the Final Subject is…
Elementary graph algorithms Chapter 22
CSC 421: Algorithm Design & Analysis
Heaps Chapter 6 Section 6.9.
Presentation transcript:

Speeding Up Enumeration Algorithms with Amortized Analysis Takeaki Uno (National Institute of Informatics, JAPAN)

Motivation & Goal There have been proposed huge number of (output) polynomial time listing, enumeration, and generation algorithms <= Good construction schemes: Back tracking, Gray code, Binary partition, and Reverse search But, there are relatively few studies on Speeding up those algorithms (reducing complexities)

Motivation & Goal (2) Recently, enumeration algorithms are used in practical problems: data mining, bioinformatics, computational linguistics  Practical & theoretical fast algorithms are required However, reducing time complexity ( per output ) is not easy

Motivation & Goal (3) Reducing # of iterations  usually, hard ( or impossible if O(#output) ) Reducing time complexity of iterations  usually, difficult ( O(n 5 )  O(n 4 ) is possible, but O(n)  O(log n), O(1) is hard )  Scheme using amortized analysis is required we propose a scheme with amortized analysis

Almost enumeration algorithms are based on recursive calls ( enumeration tree ) Iterations on lower levels take less computation time Lower levels have much iterations Observation & Idea Move computation time from upper levels to lower levels ( computation time will be amortized ) # large time short # small time long

The shape of enumeration tree depends on problems ( not like merge sort ) Difficult to decide (1) to which iteration, and (2) how much amount How to Move? Our rule is adaptive, (1) holds and receives (2) from parent to children, recursively (3) proportional to the computation time of children …? top-down

Bound by Amortized Analysis O(iter) : amortized computation time per iteration T(x) : computation time of iteration x T : maximum T(x) of bottom level iterations α >1 : a constant If α T(x) - α ≤ ∑ T(y) for any x y is a child of x  O(iter) = O ( T ) Condition (1) ^ ^

Condition (1) does not hold If several x do not hold Condition (1) : α T(x) - α ≤ ∑ T(y)  Some iterations receive much computation time from parents If x receives > α T(x) move computation time to all descendants of x x

Bound by Amortized Analysis (2) Condition (2') If ( # descendants of x ) = Ω ( T(x) ) ( or T(x) - α ≤ ∑ T(y) for any x ) y is a child of x If αT(y) + α ≥ T(x) for any x and its child y,  O(iter) = O ( T × log ( T(root) ) ) Condition (2) T(x) # T(x) ^

(case 1) a leaf iteration takes much computation time  T increases (case 2) a parent takes much computation time than all the children  Condition (1) (2') will be violated (case 3) a child takes few computation time than other children  Condition (2) will be violated Undesired Occasion ^

In each iteration, we do Trimming: remove unnecessary parts of input of each iteration  for avoiding ( case 1 & 2 ) Balancing: take balance of computation time of children  for avoiding ( case 3 ) Procedure to Avoid

Matchings Algorithm satisfying Condition (1) O(|V|)  O( 1 ) Matroid Bases Algorithm satisfying Condition (1) m :#elements O(mn)  O(1) ( oracle calls ) n :rank Directed spanning trees Trimming & balancing satisfying Condition (2') & (2) O( |V| 1/2 )  O( log 2 |V| ) Bipartite Perfect matchings Trimming & balancing satisfying Condition (2') & (2) O( |V| )  O( log|V| ) Results ( previous best  new )

Input: Graph G = ( V, E ) Output: All matchings of G Simple binary partition ( divide and conquer ) (1) Choose a max degree vertex v (2) For each e of E(v), Recursive call of G + (e) E(v): Edges incident to v G + (e) : Removal of e and edges adjacent to e  Satisfies Condition (1) At bottom level, T(x) = O(1)  T = O(1) Matchings  O(1) per matching ( = per iteration ) v E(v) e G + (e) ^

Input: Matroid M = ( E, I ) Output: All bases of M (1) Choose e 1 of E (2-a) If { e 1, e i } are circuits for e 2,…, e k Recursive calls of each M / e i and M \ { e 1,…, e k } (2-b) If { e 1, e i } are cuts for e 2,…, e k Recursive calls of M / { e 1,…, e k } and each M \ e i (2-c) Otherwise Recursive calls of M / e 1 and M \ e 1  Satisfies Condition (1) At bottom level, T(x) = O(1) oracle calls Matroid Bases  O(1) oracle calls per base ( = per iteration ) e1e1 e2e2 e3e3 e4e4 e 1,…, e k e1e1

Input: Directed Graph G = ( V, A ), a vertex r Output: All directed spanning trees of G rooted at r Binary partition with Trimming and Balancing (1) Choose a vertex v (2) Partition E + (v) into E 1 and E 2 (3) Recursive calls inputting G \ E 1 and G \ E 2 E + (v): Out-going Arcs of v Directed Spanning Trees v E + (v) r

Trimming: (1) Remove arcs included in no directed spanning tree (2) Contract arcs included in all directed spanning trees Balancing: Choose v satisfying Condition (2)  Satisfies Condition (2), (2') At bottom level, T(x) = O(log |V|) ( = T ) Directed Spanning Trees (2)  O( log 2 |V| ) per tree ( = per iteration ) ^

Input: Bipartite Graph G = ( V, E ) Output: All perfect matchings of G Binary partition with Trimming and Balancing (1) Choose a vertex v (2) Partition E(v) into E 1 and E 2 (3) Recursive calls inputting G \ E 1 and G \ E 2 Bipartite Perfect Matchings v E(v)

Trimming: Remove edges (a) included in no perfect matching (b) included in all perfect matchings (c) adjacent to edges of (b) Contract consecutive degree 2 vertices Balancing: Choose v satisfying Condition (2)  Satisfies Condition (2), (2') At bottom level, T(x) = O(1) (= T ) Bipartite Perfect Matchings (2)  O( log |V| ) per perfect matching ( = per iteration ) ^

Conclusion Proposed a new amortized analysis Proposed a new speeding up scheme ( trimming and balancing ) Proposed fast enumeration algorithms for mathings matroid bases directed spanning trees bipartite perfect mathings

Future Works Improve other algorithms possible? undirected s-t paths minimal cuts of planer graphs directed paths of planer graphs impossible? minimal cuts directed s-t paths stable sets