Principles Of Distributed Computing - ETH Z

Transcription

Principles ofDistributed ComputingRoger Wattenhoferwattenhofer@ethz.chSpring 2016

ii

Contents1 Vertex Coloring1.1 Problem & Model . . . . . . . . . . . . . . . . . . . . . . . . . . .1.2 Coloring Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 Tree Algorithms2.1 Broadcast . . . . . . . .2.2 Convergecast . . . . . .2.3 BFS Tree Construction .2.4 MST Construction . . .558.15151718193 Leader Election3.1 Anonymous Leader Election3.2 Asynchronous Ring . . . . .3.3 Lower Bounds . . . . . . . .3.4 Synchronous Ring . . . . .2323242629.4 Distributed Sorting334.1 Array & Mesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334.2 Sorting Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . 364.3 Counting Networks . . . . . . . . . . . . . . . . . . . . . . . . . . 395 Shared Memory5.1 Model . . . . . . . . . . . .5.2 Mutual Exclusion . . . . . .5.3 Store & Collect . . . . . . .5.3.1 Problem Definition .5.3.2 Splitters . . . . . . .5.3.3 Binary Splitter Tree5.3.4 Splitter Matrix . . .47474851515253556 Shared Objects596.1 Centralized Solutions . . . . . . . . . . . . . . . . . . . . . . . . . 596.2 Arrow and Friends . . . . . . . . . . . . . . . . . . . . . . . . . . 606.3 Ivy and Friends . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657 Maximal Independent Set717.1 MIS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717.2 Original Fast MIS . . . . . . . . . . . . . . . . . . . . . . . . . . 737.3 Fast MIS v2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76iii

ivCONTENTS7.4Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .808 Locality Lower Bounds858.1 Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858.2 Locality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 868.3 The Neighborhood Graph . . . . . . . . . . . . . . . . . . . . . . 889 Social Networks939.1 Small World Networks . . . . . . . . . . . . . . . . . . . . . . . . 949.2 Propagation Studies . . . . . . . . . . . . . . . . . . . . . . . . . 10010 Synchronization10.1 Basics . . . . . . . . .10.2 Synchronizer α . . . .10.3 Synchronizer β . . . .10.4 Synchronizer γ . . . .10.5 Network Partition . .10.6 Clock Synchronization.10510510610710811011211 Communication Complexity11.1 Diameter & APSP . . . . . . .11.2 Lower Bound Graphs . . . . . .11.3 Communication Complexity . .11.4 Distributed Complexity 139139142142143.12 Wireless Protocols12.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . .12.2 Initialization . . . . . . . . . . . . . . . . . . . . . .12.2.1 Non-Uniform Initialization . . . . . . . . . .12.2.2 Uniform Initialization with CD . . . . . . . .12.2.3 Uniform Initialization without CD . . . . . .12.3 Leader Election . . . . . . . . . . . . . . . . . . . . .12.3.1 With High Probability . . . . . . . . . . . . .12.3.2 Uniform Leader Election . . . . . . . . . . . .12.3.3 Fast Leader Election with CD . . . . . . . . .12.3.4 Even Faster Leader Election with CD . . . .12.3.5 Lower Bound . . . . . . . . . . . . . . . . . .12.3.6 Uniform Asynchronous Wakeup without CD .12.4 Useful Formulas . . . . . . . . . . . . . . . . . . . . .13 Stabilization14713.1 Self-Stabilization . . . . . . . . . . . . . . . . . . . . . . . . . . . 14713.2 Advanced Stabilization . . . . . . . . . . . . . . . . . . . . . . . . 15214 Labeling Schemes15714.1 Adjacency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15714.2 Rooted Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15914.3 Road Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160

CONTENTSv15 Fault-Tolerance & Paxos16515.1 Client/Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16515.2 Paxos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16916 Consensus16.1 Two Friends . . . . . . . .16.2 Consensus . . . . . . . . .16.3 Impossibility of Consensus16.4 Randomized Consensus .16.5 Shared Coin . . . . . . . .17717717717818318617 Byzantine Agreement17.1 Validity . . . . . . . . . . . . . . . .17.2 How Many Byzantine Nodes? . . . .17.3 The King Algorithm . . . . . . . . .17.4 Lower Bound on Number of Rounds17.5 Asynchronous Byzantine Agreement.189190191193194195.18 Authenticated Agreement19918.1 Agreement with Authentication . . . . . . . . . . . . . . . . . . . 19918.2 Zyzzyva . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20119 Quorum Systems19.1 Load and Work . . . . . . .19.2 Grid Quorum Systems . . .19.3 Fault Tolerance . . . . . . .19.4 Byzantine Quorum Systems.21121221321521820 Eventual Consistency & Bitcoin20.1 Consistency, Availability and Partitions20.2 Bitcoin . . . . . . . . . . . . . . . . . . .20.3 Smart Contracts . . . . . . . . . . . . .20.4 Weak Consistency . . . . . . . . . . . .22322322523123321 Distributed Storage21.1 Consistent Hashing . . . . . . . . . . . . . . . . . . . . . . . . . .21.2 Hypercubic Networks . . . . . . . . . . . . . . . . . . . . . . . . .21.3 DHT & Churn . . . . . . . . . . . . . . . . . . . . . . . . . . . .23723723824422 Game Theory22.1 Introduction . . . . .22.2 Prisoner’s Dilemma .22.3 Selfish Caching . . .22.4 Braess’ Paradox . . .22.5 Rock-Paper-Scissors22.6 Mechanism Design .251251251253255256257.

viCONTENTS23 Dynamic Networks23.1 Synchronous Edge-Dynamic Networks23.2 Problem Definitions . . . . . . . . . .23.3 Basic Information Dissemination . . .23.4 Small Messages . . . . . . . . . . . . .23.4.1 k-Verification . . . . . . . . . .23.4.2 k-Committee Election . . . . .23.5 More Stable Graphs . . . . . . . . . .24 All-to-All Communication25 Multi-Core Computing25.1 Introduction . . . . . . . . .25.1.1 The Current State of25.2 Transactional Memory . . .25.3 Contention Management . .261261262263266266267269273. . . . . . . . . . . . . . .Concurrent Programming. . . . . . . . . . . . . . . . . . . . . . . . . . . . .28128128128328426 Dominating Set29326.1 Sequential Greedy Algorithm . . . . . . . . . . . . . . . . . . . . 29426.2 Distributed Greedy Algorithm . . . . . . . . . . . . . . . . . . . . 29527 Routing27.1 Array . . . . . . . . . . . . . . . . . . .27.2 Mesh . . . . . . . . . . . . . . . . . . . .27.3 Routing in the Mesh with Small Queues27.4 Hot-Potato Routing . . . . . . . . . . .27.5 More Models . . . . . . . . . . . . . . .30330330430530630828 Routing Strikes Back31128.1 Butterfly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31128.2 Oblivious Routing . . . . . . . . . . . . . . . . . . . . . . . . . . 31228.3 Offline Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313

IntroductionWhat is Distributed Computing?In the last few decades, we have experienced an unprecedented growth in thearea of distributed systems and networks. Distributed computing now encompasses many of the activities occurring in today’s computer and communicationsworld. Indeed, distributed computing appears in quite diverse application areas:The Internet, wireless communication, cloud or parallel computing, multi-coresystems, mobile networks, but also an ant colony, a brain, or even the humansociety can be modeled as distributed systems.These applications have in common that many processors or entities (oftencalled nodes) are active in the system at any moment. The nodes have certaindegrees of freedom: they have their own hard- and software. Nevertheless, thenodes may share common resources and information, and, in order to solvea problem that concerns several—or maybe even all—nodes, coordination isnecessary.Despite these commonalities, a human brain is of course very different from aquadcore processor. Due to such differences, many different models and parameters are studied in the area of distributed computing. In some systems the nodesoperate synchronously, in other systems they operate asynchronously. There aresimple homogeneous systems, and heterogeneous systems where different typesof nodes, potentially with different capabilities, objectives etc., need to interact. There are different communication techniques: nodes may communicate byexchanging messages, or by means of shared memory. Occasionally the communication infrastructure is tailor-made for an application, sometimes one has towork with any given infrastructure. The nodes in a system often work togetherto solve a global task, occasionally the nodes are autonomous agents that havetheir own agenda and compete for common resources. Sometimes the nodes canbe assumed to work correctly, at times they may exhibit failures. In contrastto a single-node system, distributed systems may still function correctly despitefailures as other nodes can take over the work of the failed nodes. There aredifferent kinds of failures that can be considered: nodes may just crash, or theymight exhibit an arbitrary, erroneous behavior, maybe even to a degree whereit cannot be distinguished from malicious (also known as Byzantine) behavior.It is also possible that the nodes follow the rules indeed, however they tweakthe parameters to get the most out of the system; in other words, the nodes actselfishly.Apparently, there are many models (and even more combinations of models)that can be studied. We will not discuss them in detail now, but simply define1

2CONTENTSthem when we use them. Towards the end of the course a general picture shouldemerge, hopefully!Course OverviewThis course introduces the basic principles of distributed computing, highlighting common themes and techniques. In particular, we study some of the fundamental issues underlying the design of distributed systems: Communication: Communication does not come for free; often communication cost dominates the cost of local processing or storage. Sometimeswe even assume that everything but communication is free. Coordination: How can you coordinate a distributed system so that itperforms some task efficiently? How much overhead is inevitable? Fault-tolerance: A major advantage of a distributed system is that evenin the presence of failures the system as a whole may survive. Locality: Networks keep growing. Luckily, global information is not alwaysneeded to solve a task, often it is sufficient if nodes talk to their neighbors.In this course, we will address whether a local solution is possible. Parallelism: How fast can you solve a task if you increase your computational power, e.g., by increasing the number of nodes that can share theworkload? How much parallelism is possible for a given problem? Symmetry breaking: Sometimes some nodes need to be selected to orchestrate computation or communication. This is achieved by a techniquecalled symmetry breaking. Synchronization: How can you implement a synchronous algorithm in anasynchronous environment? Uncertainty: If we need to agree on a single term that fittingly describesthis course, it is probably “uncertainty”. As the whole system is distributed, the nodes cannot know what other nodes are doing at this exactmoment, and the nodes are required to solve the tasks at hand despite thelack of global knowledge.Finally, there are also a few areas that we will not cover in this course,mostly because these topics have become so important that they deserve theirown courses. Examples for such topics are distributed programming or security/cryptography.In summary, in this class we explore essential algorithmic ideas and lowerbound techniques, basically the “pearls” of distributed computing and networkalgorithms. We will cover a fresh topic every week.Have fun!

BIBLIOGRAPHY3Chapter NotesMany excellent text books have been written on the subject. The book closestto this course is by David Peleg [Pel00], as it shares about half of the material. Amain focus of Peleg’s book are network partitions, covers, decompositions, andspanners – an interesting area that we will only touch in this course. There exista multitude of other text books that overlap with one or two chapters of thiscourse, e.g., [Lei92, Bar96, Lyn96, Tel01, AW04, HKP 05, CLRS09, Suo12].Another related course is by James Aspnes [Asp] and one by Jukka Suomela[Suo14].Some chapters of this course have been developed in collaboration with (former) Ph.D. students, see chapter notes for details. Many students have helpedto improve exercises and script. Thanks go to Philipp Brandes, Raphael Eidenbenz, Roland Flury, Klaus-Tycho Förster, Stephan Holzer, Barbara Keller,Fabian Kuhn, Christoph Lenzen, Thomas Locher, Remo Meier, Thomas Moscibroda, Regina O’Dell, Yvonne-Anne Pignolet, Jochen Seidel, Stefan Schmid,Johannes Schneider, Jara Uitto, Pascal von Rickenbach (in alphabetical order).Bibliography[Asp] James Aspnes. Notes on Theory of Distributed Systems.[AW04] Hagit Attiya and Jennifer Welch. Distributed Computing: Fundamentals, Simulations and Advanced Topics (2nd edition). John Wiley Interscience, March 2004.[Bar96] Valmir C. Barbosa. An introduction to distributed algorithms. MITPress, Cambridge, MA, USA, 1996.[CLRS09] Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, andClifford Stein. Introduction to Algorithms (3. ed.). MIT Press, 2009.[HKP 05] Juraj Hromkovic, Ralf Klasing, Andrzej Pelc, Peter Ruzicka, andWalter Unger. Dissemination of Information in CommunicationNetworks - Broadcasting, Gossiping, Leader Election, and FaultTolerance. Texts in Theoretical Computer Science. An EATCS Series. Springer, 2005.[Lei92] F. Thomson Leighton. Introduction to parallel algorithms and architectures: array, trees, hypercubes. Morgan Kaufmann PublishersInc., San Francisco, CA, USA, 1992.[Lyn96] Nancy A. Lynch. Distributed Algorithms. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 1996.[Pel00] David Peleg. Distributed Computing: a Locality-Sensitive Approach.Society for Industrial and Applied Mathematics, Philadelphia, PA,USA, 2000.[Suo12] Jukka Suomela. Deterministic Distributed Algorithms, 2012.[Suo14] Jukka Suomela. Distributed algorithms. Online textbook, 2014.

4CONTENTS[Tel01] Gerard Tel. Introduction to Distributed Algorithms. Cambridge University Press, New York, NY, USA, 2nd edition, 2001.

Chapter 1Vertex ColoringVertex coloring is an infamous graph theory problem. It is also a useful toyexample to see the style of this course already in the first lecture. Vertex coloringdoes have quite a few practical applications, for example in the area of wirelessnetworks where coloring is the foundation of so-called TDMA MAC protocols.Generally speaking, vertex coloring is used as a means to break symmetries,one of the main themes in distributed computing. In this chapter we will notreally talk about vertex coloring applications, but treat the problem abstractly.At the end of the class you probably learned the fastest algorithm ever! Let usstart with some simple definitions and observations.1.1Problem & ModelProblem 1.1 (Vertex Coloring). Given an undirected graph G (V, E), assigna color cv to each vertex v V such that the following holds: e (v, w) E cv 6 cw .Remarks: Throughout this course, we use the terms vertex and node interchangeably. The application often asks us to use few colors! In a TDMA MAC protocol, for example, less colors immediately imply higher throughput.However, in distributed computing we are often happy with a solutionwhich is suboptimal. There is a tradeoff between the optimality of asolution (efficacy), and the work/time needed to compute the solution(efficiency).Assumption 1.3 (Node Identifiers). Each node has a unique identifier, e.g.,its IP address. We usually assume that each identifier consists of only log n bitsif the system has n nodes.5

6CHAPTER 1. VERTEX COLORING1233Figure 1.2: 3-colorable graph with a valid coloring.Remarks: Sometimes we might even assume that the nodes exactly have identifiers 1, . . . , n. It is easy to see that node identifiers (as defined in Assumption 1.3)solve the coloring problem 1.1, but using n colors is not exciting. Howmany colors are needed is a well-studied problem:Definition 1.4 (Chromatic Number). Given an undirected Graph G (V, E),the chromatic number χ(G) is the minimum number of colors to solve Problem1.1.To get a better understanding of the vertex coloring problem, let us first lookat a simple non-distributed (“centralized”) vertex coloring algorithm:Algorithm 1.5 Greedy Sequential1: while there is an uncolored vertex v do2:color v with the minimal color (number) that does not conflict with thealready colored neighbors3: end whileDefinition 1.6 (Degree). The number of neighbors of a vertex v, denoted byδ(v), is called the degree of v. The maximum degree vertex in a graph G definesthe graph degree (G) .Theorem 1.7. Algorithm 1.5 is correct and terminates in n “steps”. Thealgorithm uses at most 1 colors.Proof: Since each node has at most neighbors, there is always at least onecolor free in the range {1, . . . , 1}.Remarks: In Definition 1.11 we will see what is meant by “step”. Sometimes χ(G) 1.Definition 1.8 (Synchronous Distributed Algorithm). In a synchronous distributed algorithm, nodes operate in synchronous rounds. In each round, eachnode executes the following steps:1. Send messages to neighbors in graph (of reasonable size).

1.1. PROBLEM & MODEL72. Receive messages (that were sent by neighbors in step 1 of the same round).3. Do some local computation (of reasonable complexity).Remarks: Any other step ordering is fine. What does “reasonable” mean in this context? We are somewhatflexible here, and different model variants exist. Generally, we willdeal with algorithms that only do very simple computations (a comparison, an addition, etc.). Exponential-time computation is usuallyconsidered cheating in this context. Similarly, sending a message witha node ID, or a value is considered okay, whereas sending really longmessages is fishy. We will have more exact definitions later, when weneed them. We can build a distributed version of Algorithm 1.5:Algorithm 1.9 Reduce1: Assume that initially all nodes have IDs2: Each node v executes the following code:3: node v sends its ID to all neighbors4: node v receives IDs of neighbors5: while node v has an uncolored neighbor with higher ID do6:node v sends “undecided” to all neighbors7:node v receives new decisions from neighbors8: end while9: node v chooses the smallest admissible free color10: node v informs all its neighbors about its choice1310013255Figure 1.10: Vertex 100 receives the lowest possible color.Definition 1.11 (Time Complexity). For synchronous algorithms (as defined in1.8) the time complexity is the number of rounds until the algorithm terminates.The algorithm terminates when the last node terminates.Theorem 1.12. Algorithm 1.9 is correct and has time complexity n. The algorithm uses at most 1 colors.Proof. Nodes choose colors that are different from their neighbors, and no twoneighbors choose concurrently. In each round at least one node chooses a color,so we are done after at most n rounds.

8CHAPTER 1. VERTEX COLORINGRemarks: In the worst case, this algorithm is still not better than sequential. Moreover, it seems difficult to come up with a fast algorithm. Maybe it’s better to first study a simple special case, a tree, and thengo from there.1.2Coloring TreesLemma 1.13. χ(T ree) 2Proof. Call some node the root of the tree. If the distance of a node to the rootis odd (even), color it 1 (0). An odd node has only even neighbors and viceversa.Remarks: If we assume that each node knows its parent (root has no parent)and children in a tree, this constructive proof gives a very simplealgorithm:Algorithm 1.14 Slow Tree Coloring1: Color the root 0, root sends 0 to its children2: Each node v concurrently executes the following code:3: if node v receives a message cp (from parent) then4:node v chooses color cv 1 cp5:node v sends cv to its children (all neighbors except parent)6: end ifTheorem 1.15. Algorithm 1.14 is correct. If each node knows its parent and itschildren, the time complexity is the tree height which is bounded by the diameterof the tree.Remarks: How can we determine a root in a tree if it is not already given? Wewill figure that out later. The time complexity of the algorithm is the height of the tree. Nice trees, e.g., balanced binary trees, have logarithmic height, thatis we have a logarithmic time complexity. However, if the tree has a degenerated topology, the time complexitymay again be up to n, the number of nodes. This algorithm is not very exciting. Can we do better than logarithmic?

1.2. COLORING TREES9Here is the idea of the algorithm: We start with color labels that have log n bits.In each round we compute a new label with exponentially smaller size than theprevious label, still guaranteeing to have a valid vertex coloring! The algorithmterminates in log n time. Log-Star?! That’s the number of logarithms (to thebase 2) you need to take to get down to 2. Formally:Definition 1.16 (Log-Star). x 2 : log x : 1 x 2 : log x : 1 log (log x)Remarks: Log-star is an amazingly slowly growing function. Log-star of all theatoms in the observable universe (estimated to be 1080 ) is 5. So logstar increases indeed very slowly! There are functions which groweven more slowly, such as the inverse Ackermann function, however,the inverse Ackermann function of all the atoms is already 4.Algorithm 1.17 “6-Color”1: Assume that initially the nodes have IDs of size log n bits2: The root assigns itself the label 03: Each other node v executes the following code4: send own color cv to all children5: repeat6:receive color cp from parent7:interpret cv and cp as bit-strings8:let i be the index of the smallest bit where cv and cp differ9:the new label is i (as bitstring) followed by the ith bit of cv10:send cv to all children11: until cw {0, . . . , 5} for all nodes wExample:Algorithm 1.17 executed on the following part of a 10010000 100100101010001 .111001Theorem 1.18. Algorithm 1.17 terminates in log n k time, where k is aconstant independent of n.Proof. We need to show that parent p and child c always have different colors.Initially, this is true, since all nodes start out with their unique ID. In a round,let i be the smallest index where child c has a different bit from parent p. Ifparent p differs in a different index bit j 6 i from its own parent, parent andchild will compute different colors in that round. On the other hand, if j i,the symmetry is broken by p having a different bit at index i.Regarding runtime, note that the size of the largest color shrinks dramatically in each round, apart from the symmetry-breaking bit, exactly as a logarithmic function. With some (tedious and boring) machinery, one can show

10CHAPTER 1. VERTEX COLORINGthat indeed every node will have a color in the range {0, . . . , 5} in log n krounds.Remarks: Let us have a closer look at the end game of the algorithm. Colors11 (in binary notation, i.e., 6 or 7 in decimal notation) will not bechosen, because the node will then do another round. This gives atotal of 6 colors (i.e., colors 0,. . . , 5). What about that last line of the loop? How do the nodes know thatall nodes now have a color in the range {0, . . . , 5}? The answer to thisquestion is surprisingly complex. One may hardwire the number ofrounds into the until statement, such that all nodes execute the loopfor exactly the same number of rounds. However, in order to do so,all nodes need to know n, the number of nodes, which is ugly. Thereare (non-trivial) solutions where nodes do not need to know n, seeexercises. Can one reduce the number of colors? Note that Algorithm 1.9 doesnot work (since the degree of a node can be much higher than 6)! Forfewer colors we need to have siblings monochromatic!Algorithm 1.19 Shift Down1: Each other node v concurrently executes the following code:2: Recolor v with the color of parent3: Root chooses a new (different) color from {0, 1, 2}Lemma 1.20. Algorithm 1.19 preserves coloring legality; also siblings are monochromatic.Now Algorithm 1.9 can be used to reduce the number of used colors from 6 to3.Algorithm 1.21 Six-2-Three1: Each node v concurrently executes the following code:2: for x 5, 4, 3 do3:Perform subroutine Shift down (Algorithm 1.19)4:if cv x then5:choose the smallest admissible new color cv {0, 1, 2}6:end if7: end forTheorem 1.23. Algorithms 1.17 and 1.21 color a tree with three colors in timeO(log n).

1.2. COLORING TREES11Figure 1.22: Possible execution of Algorithm 1.21.Remarks: The term O() used in Theorem 1.18 is called “big O” and is oftenused in distributed computing. Roughly speaking, O(f ) means “inthe order of f , ignoring constant factors and smaller additive terms.”More formally, for two functions f and g, it holds that f O(g) ifthere are constants x0 and c so that f (x) c g(x) for all x x0 .For an elaborate discussion on the big O notation we refer to otherintroductory math or computer science classes, or Wikipedia. A fast tree-coloring with only 2 colors is more than exponentially moreexpensive than coloring with 3 colors. In a tree degenerated to a list,nodes far away need to figure out whether they are an even or oddnumber of hops away from each other in order to get a 2-coloring. Todo that one has to send a message to these nodes. This costs timelinear in the number of nodes. The idea of this algorithm can be generalized, e.g., to a ring topology.Also a general graph with constant degree can be colored with 1 colors in O(log n) time. The idea is as follows: In each step,a node compares its label to each of its neighbors, constructing a

12CHAPTER 1. VERTEX COLORINGlogarithmic difference-tag as in Algorithm 1.17. Then the new labelis the concatenation of all the difference-tags. For constant degree ,this gives a 3 -label in O(log n) steps. Algorithm 1.9 then reducesthe number of colors to 1 in 23 (this is still a constant for constant !) steps. Unfortunately, coloring a general graph is not yet possible with thistechnique. We will see another technique for that in Chapter 7. Withthis technique it is possible to color a general graph with 1 colorsin O(log n) time. A lower bound shows that many of these log-star algorithms areasymptotically (up to constant factors) optimal. We will see thatlater.Chapter NotesThe basic technique of the log-star algorithm is by Cole and Vishkin [CV86]. Atight bound of 12 log n was proven recently [RS15]. The technique can be generalized and extended, e.g., to a ring topology or to graphs with constant degree[GP87, GPS88, KMW05]. Using it as a subroutine, one can solve many problemsin log-star time. For instance, one can color so-called growth bounded graphs (amodel which includes many natural graph classes, for instance unit disk graphs)asymptotically optimally in O(log n) time [SW08]. Actually, Schneider et al.show that many classic combinatorial problems beyond coloring can be solvedin log-star time in growth bounded and other restricted graphs.In a later chapter we learn a Ω(log n) lower bound for coloring and relatedproblems [Lin92]. Linial’s paper also contains a number of other results oncoloring, e.g., that any algorithm for coloring d-regular trees of radius r thatrun in time at most 2r/3 require at least Ω( d) colors.For general graphs, later we will learn fast coloring algorithms that use amaximal independent sets as a base. Since coloring exhibits a trade-off betweenefficacy and efficiency, many different results for general graphs exist, e.g., [PS96,KSOS06, BE09, Kuh09, SW10, BE11b, KP11, BE11a, BEPS12, PS13, CPS14,BEK14].Some parts of this chapter are also discussed in Chapter 7 of [Pel00], e.g.,the proof of Theorem 1.18.Bibliography[BE09] Leonid Barenboim and Michael Elkin. Distributed (delta 1)-coloringin linear (in delta) time. In 41st ACM Symposium On Theory ofComputing (STOC), 2009.[BE11a] Leonid Barenboim and Michael Elkin. Combinatorial Algorithms forDistributed Graph Coloring. In 25th International Symposium onDIStributed Computing, 2011.[BE11b] Leonid Barenboim and Michael Elkin. Deterministic Distributed Vertex Coloring in Polylogarithmic Time. J. ACM, 58(5):23, 2011.

BIBLIOGRAPHY13[BEK14] Leonid Barenboim, Michael Elkin, and Fabian Kuhn. Distributed(delta 1)-coloring in linear (in delta) time. SIAM J. Comput.,43(1):72–95, 2014.[BEPS12] Leonid Barenboim, Michael Elkin, Seth Pettie, and Johannes Schneider. The locality of distributed symmetry breaking. In Foundationsof Computer Science (FOCS), 2012 IEEE 53rd Annual Symposiumon, pages 321–330, 2012.[CPS14] Kai-Min Chung, Seth Pettie, and

Many excellent text books have been written on the subject. The book closest to this course is by David Peleg [Pel00], as it shares about half of the material. A main focus of Peleg's book are network partitions, covers, decompositions, and spanners { an interesting area that we will only touch in this course. There exist