Doctoral Thesis Graph Algorithms
Total Page:16
File Type:pdf, Size:1020Kb
Charles University in Prague Faculty of Mathematics and Physics Doctoral Thesis Graph Algorithms Martin Mares Department of Applied Mathematics Malostransk´en´am.25 Prague, Czech Republic Supervisor: Prof. RNDr. Jaroslav Neˇsetˇril,DrSc. Branch I4: Discrete Models and Algorithms 2008 I hereby declare that I have written this thesis on my own and using exclusively the cites sources. For any work in the thesis that has been co-published with other authors, I have the permission of them all to include this work in my thesis. I authorize the Charles University to lend this document to other institutions and individuals for academic or research purposes. Martin Mareˇs Prague, May 4th, 2008 Preface This thesis tells the story of two well-established problems of algorithmic graph theory: the minimum spanning trees and ranks of permutations. At distance, both problems seem to be simple, boring and already solved, because we have polynomial- time algorithms for them since ages. But when we come closer and seek algorithms that are really efficient, the problems twirl and twist and withstand many a brave attempt at the optimum solution. They also reveal a vast and diverse landscape of a deep and beautiful theory. Still closer, this landscape turns out to be interwoven with the intricate details of various models of computation and even of arithmetics itself. I have tried to cover all known important results on both problems and unite them in a single coherent theory. At many places, I have attempted to contribute my own little stones to this mosaic: several new results, simplifications of existing ones, and last, but not least filling in important details where the original authors have missed some. When compared with the earlier surveys on the minimum spanning trees, most notably Graham and Hell [GH85] and Eisner [Eis97], this work adds many of the recent advances, the dynamic algorithms and also the relationship with computa- tional models. No previous work covering the ranking problems in their entirety is known. The early parts of this thesis also served as a basis for a course on graph algorithms which I was teaching at our faculty during years 2006 and 2007. They are included in the textbook [Mar07] which I have written for this course. My original results The lower bound in Section 1.5. Not published yet. The tree isomorphism algorithm in Section 2.2. Not published yet. Both algorithms for minor-closed graph classes in Section 3.1. Published in [Mar04]. The linear-time verification algorithm in Section 3.4 is a simplification of the algorithm of King [Kin97] and it corrects many omissions in the original paper. Not published yet. The ranking algorithms in Sections 7.1 to 7.3 are results of joint research with Milan Straka. Published in [MS07]. The remaining sections of Chapter 7 contain unpublished original results. Other minor contributions The flattening procedure in Section 2.2. Included in [Mar04]. The unified view of vector computations in Section 2.4. Published in the textbook [Mar07]. The main ideas of this section were also included in the yearbook of the Czech Mathematical Olympiad [HMN+07]. Slight simplifications of the soft heaps and their analysis in Section 4.1. The dynamic MST algorithm for graphs with limited edge weights in Sec- tion 5.4. Acknowledgements First of all, I would like to thank my supervisor, Jaroslav Neˇsetˇril,for intro- ducing me to the world of discrete mathematics and gently guiding my attempts to explore it with his deep insight. I am very grateful to all members of the Department of Applied Mathematics and the Institute for Theoretical Computer Science for the work environment which was friendly and highly inspiring. I cannot forget the par- ticipants of the department’s seminars, who have listened to my talks and provided lots of important feedback. I also send my acknowledgements to the members of the Math department at ETH Z¨urich and of DIMACS at the Rutgers University (especially to J´anosKoml´os)where I spent several pleasant months working on what finally become a part of this thesis. I also thank to my family for supporting me during the plentiful years of my study, to my girlfriend Aniˇcka for lots of patience when I was caught up by my work and hardly speaking at all, to all the polar bears of Kobylisy for their furry presence, and finally to our cats Minuta and Dami´anfor their mastership in hiding my papers, which has frequently forced me to think of new ways of looking at problems when the old ones were impossible to find. Notation I have tried to stick to the usual notation except where it was too inconve- nient. Most symbols are defined at the place where they are used for the first time. A complete index of symbols with pointers to their definitions is then available in Appendix A. This appendix also describes the formalism of multigraphs and of the Ackermann’s function, both of which are not defined consistently in the common literature. To avoid piling up too many symbols at places that speak about a single fixed graph, this graph is always called G, its set of vertices and edges are denoted by V and E respectively, and I also use n for the number of its vertices and m for the number of edges. At places where there could be a danger of confusion, more explicit notation is used instead. So, my gentle reader, let us nestle deep in an ancient wing armchair. The saga of the graph algorithms begins ... Table of contents Preface ....................................................................... 3 Table of contents ............................................................. 5 1. Minimum Spanning Trees ................................................. 7 1.1. The Problem ............................................................ 7 1.2. Basic properties ......................................................... 8 1.3. The Red-Blue meta-algorithm .......................................... 11 1.4. Classical algorithms .................................................... 13 1.5. Contractive algorithms ................................................. 16 1.6. Lifting restrictions ...................................................... 20 2. Fine Details of Computation ............................................. 21 2.1. Models and machines ................................................... 21 2.2. Bucket sorting and unification .......................................... 25 2.3. Data structures on the RAM ........................................... 29 2.4. Bits and vectors ........................................................ 30 2.5. Q-Heaps ............................................................... 35 3. Advanced MST Algorithms ............................................... 43 3.1. Minor-closed graph classes .............................................. 43 3.2. Iterated algorithms ..................................................... 47 3.3. Verification of minimality ............................................... 52 3.4. Verification in linear time ............................................... 56 3.5. A randomized algorithm ................................................ 60 4. Approaching Optimality .................................................. 65 4.1. Soft heaps .............................................................. 65 4.2. Robust contractions .................................................... 75 4.3. Decision trees .......................................................... 79 4.4. An optimal algorithm .................................................. 82 5. Dynamic Spanning Trees ................................................. 87 5.1. Dynamic graph algorithms .............................................. 87 5.2. Eulerian Tour trees ..................................................... 90 5.3. Dynamic connectivity .................................................. 93 5.4. Dynamic spanning forests ............................................... 96 5.5. Almost minimum trees ................................................ 100 6. Applications ............................................................ 105 6.1. Special cases and related problems ..................................... 105 6.2. Practical algorithms ................................................... 107 7. Ranking Combinatorial Structures ...................................... 109 7.1. Ranking and unranking ................................................ 109 7.2. Ranking of permutations .............................................. 109 7.3. Ranking of k-permutations ............................................ 112 7.4. Restricted permutations ............................................... 113 7.5. Hatcheck lady and other derangements ................................ 118 8. Epilogue ................................................................ 121 A. Notation ............................................................... 123 A.1. Symbols .............................................................. 123 A.2. Multigraphs and contractions ......................................... 125 A.3. Ackermann’s function and its inverses ................................. 126 B. Bibliography ........................................................... 129 1. Minimum Spanning Trees 1.1. The Problem The problem of finding a minimum spanning tree of a weighted graph is one of the best studied problems in the area of combinatorial optimization since its birth. Its colorful history (see [GH85] and [Neˇs97]for the full account) begins in 1926 with the pioneering work of Bor˚uvka [Bor26a]1, who studied