1 Distributed Vertex Coloring
2 Vertex Coloring: each vertex is assigned a color
3 Vertex Coloring: each vertex is assigned a color
4 Valid Vertex Coloring: each vertex is assigned a color so that any two adjacent nodes have different color Valid vertex coloring
5 Invalid vertex coloring
6 In algorithms, each color can be represented by an integer
7 a valid coloring with colors Example:
8 Chromatic number : The smallest number of colors that can be used to give a valid coloring in graph This number cannot be approximated (within a reasonable factor) unless
9 Sequential -coloring For any graph there is a -coloring Therefore,
10 Basic idea for: Each node keeps a color Palette of size : :degree of node Color:
11 Color Palette of node Suppose that neighbors of have picked colors Color:
12 Color Palette of node Color: unavailable color available color At least one available color Number of available colors (uncolored neighbors)
13 Color Palette of node Color: Worst case scenario: every neighbor has a different color Still, a color is available
14 Color Palette of node Color: Node can pick color for itself
15 1. Pick an uncolored node 2. Let be an available color (from ‘s palette) (such a color always exists) 3. Color node with color 4. Mark as unavailable in the color palette of every neighbor of Sequential Coloring Algorithm Repeat: Until all nodes are colored Mark all entries in the palettes of all the nodes as available
16 Palette of All are available colors Example execution
17 Palette of Picks first available color
18 Palette of
19 Palette of Picks first available color
20 Palette of Picks first available color
21 Palette of Picks first available color
22 Termination
23 Coloring and MIS Independent Set In a valid coloring, the nodes of same color form an independent set
24 However, the independent set may not be maximal: New Independent set (Maximal)
25 Vertex Coloring is reduced to MIS Consider an uncolored graph Repeat: Coloring algorithm for using MIS: Find a MIS in the uncolored nodes; Assign color to each node in MIS; Until every node is colored;
26 Example: initially, all nodes are uncolored
27 Iteration 1: Find an MIS of the uncolored nodes and give to the nodes color
28 Iteration 2: Find an MIS of the uncolored nodes and give to the nodes color
29 Iteration 3: Find an MIS of the uncolored nodes and give to the nodes color
30 The algorithm terminates in At end of an iteration, each uncolored node is adjacent to a node in the MIS Lemma: Proof: iterations
31 Thus, the effective degree of each uncolored node is reduced by at least one at each iteration The degree in the uncolored graph
32 After at most iterations, the degree of each uncolored node becomes 0 At iteration each uncolored node has to enter MIS END OF PROOF
33 Since the number of iteration is, we obtain a coloring (at each iteration we use a different color)
34 Using Luby’s distributed and randomized MIS algorithm, we obtain a coloring algorithm which gives: -coloring in time steps #iterations time to compute MIS with high probability
35 ( is the number of nodes) A Simple Randomized -Coloring Algorithm Randomized Algorithm Distributed Algorithm Running time: with high probability
36 Each node has a palette with colors Initially all colors in palette are available Palette of node (Recall: is the node’s degree)
37 The algorithm works in phases At the beginning of a phase, there are two kinds of nodes: colored uncolored
38 Palette of node unavailable color available color
39 Palette of node Node chooses randomly and uniformly an available color
40 Palette of node At the same time, uncolored neighbors pick randomly a color too (from their palettes)
41 Palette of node If then node accepts color for all and exits the algorithm
42 Palette of node If then node rejects color for some Conflict
43 All the nodes that conflict reject their colors and try again in the next phase Palette of node
44 Algorithm for node Repeat (iteration = phase) Pick a color uniformly at random from available palette colors; Send color to neighbors; If (some neighbor chose same color ) Then Reject color ; Else Accept color ; Inform neighbors about color ; (so that they mark color as unavailable) Until color is accepted;
45 Example execution
46 Phase 1: (iteration 1 of synchronous exectution) Nodes pick random colors
47 Successful Colors
48 Phase 2:(iteration 2) Nodes pick random colors
49 Successful Colors
50 Phase 3: (iteration 3) Nodes pick random colors
51 End of execution
52 Analysis Palette of node unavailable color available color Consider phase (iteration ) Set of available colors: Example:
53 : set of neighbors of which are uncolored at the beginning of the phase Example:
54 Palette of node At the beginning of phase
55 Palette of node : available colors after every node in chooses a random color Color inColor used by
56 Since at most colors in are used by neighbors Palette of node
57 A successful color choice for node : node has picked a color in (this color is not picked by any neighbor) Probability of success: space of all random choices space of successful random choices
58 Probability that node succeeds in a phase: Probability that node fails for phases: at least at most is the number of nodes
59 Probability that node fails for phases: Probability that some node fails for phases: at most Probability that every node succeeds in the first phases: at least at most
60 The algorithm terminates in phases with probability at least Duration of each phase:time steps Total time steps: (with high probability)
61 Distributed Vertex Coloring Part II
62 A Randomized -Coloring Algorithm Randomized Algorithm Distributed Algorithm Running time: with high probability (similar with the -coloring algorithm, but now the color palette size is )
63 Each node has a palette with colors Initially all colors in palette are available Palette of node (Recall: is the node’s degree)
64 : uncolored neighbors of Example: At the beginning of a phase: : uncolored degree of
65 In conflicts, the node with the highest uncolored degree wins Example 1 Beginning of phase
66 In conflicts, the node with the highest uncolored degree wins Random color choices
67 In conflicts, the node with the highest uncolored degree wins End of phase
68 In conflicts, the node with the highest uncolored degree wins Example 2 Beginning of phase
69 In conflicts, the node with the highest uncolored degree wins Random color choices
70 In conflicts, the node with the highest uncolored degree wins End of phase
71 If both nodes have same degree, both reject their color Example 3 Beginning of phase
72 If both nodes have same degree, both reject their color Random color choices
73 If both nodes have same degree, both reject their color End of phase
74 Algorithm for node Repeat Pick a color uniformly at random from available palette colors; Send color to neighbors; If (some neighbor with chose same color ) Then Reject color ; Else Accept color ; Inform neighbors about color ; (so that they mark color as unavailable) Until color is accepted; (iteration = phase)
75 Example execution
76 Phase 1: (iteration 1) Nodes pick random colors
77 For this phase, uncolored degree = degree Conflicts The nodes of higher uncolored degree win
78 Successful colors
79 Phase 2:(iteration 2) Nodes pick random colors
80 Conflicts The nodes of higher uncolored degree win
81 Successful colors
82 Phase 3:(iteration 3) Nodes pick random colors
83 Successful colors End of execution
84 Analysis Palette of uncolored node unavailable color available color Consider phase (iteration ) Set of available colors: Example:
85 Number of available colors: Palette sizeMaximum unavailable colors
86 If then every color choice is a success So suppose that
87 Event : node successfully accepts a color in current phase We want to compute the probability of: We will prove that is at least constant
88 Event : node successfully picks and then accepts color (available color)
89 Note that the events and are mutually exclusive for any pair of colors Any two such events cannot occur simultaneously
90 since, success for node in current phase is to successfully accept some color in
91 since are mutually exclusive
92 :nodes in with same or higher uncolored degree than Example:
93 Note that for any
94 Event that node picks randomly color Event that no node in picks randomly color
95 Since node picks randomly and uniformly a color from the available colors Probability that node picks color
96 Event that no uncolored neighbor of picks randomly color Event that uncolored neighbor does not pick color
97 This holds because the events are independent
98 Consider some
99
100 Fundamental inequalities
101
102
103 This holds since and are independent events (the nodes pick randomly their colors independent from one another)
104
105 Probability of success
106 Probability that node succeeds in a phase: Probability that node fails in a phase: at least at most Note that is a constant
107 Probability that node fails for phases: at most is the number of nodes
108 Probability that node fails for phases: Probability that some node fails for phases: at most Probability that every node succeeds in the first phases: at least at most
109 The algorithm terminates in phases with probability at least Duration of each phase:time steps Total time steps: (with high probability) END OF ANALYSIS
110 Alternative Randomized -Coloring Algorithm Randomized Algorithm Distributed Algorithm Running time: with high probability
111 in conflicts, every conflicting node rejects the color Same with previous algorithm (palette for node is ) But: (regardless of the uncolored degrees)
112 Algorithm for node Repeat Pick a color uniformly at random from available palette colors; Send color to neighbors; If (some neighbor chose same color ) Then Reject color ; Else Accept color ; inform neighbors about color ; (so that they mark color as unavailable) Until color is accepted;
113 Example execution
114 Phase 1:
115 Successful Colors
116 Phase 2:
117 Successful Colors
118 Phase 3:
119 End of execution
120 Analysis Palette of node unavailable color available color Consider phase (iteration ) Set of available colors: Example:
121 : uncolored neighbors of Example: At the beginning of a phase:
122 Number of available colors: Palette sizeMaximum unavailable colors
123 If then every color choice is a success So suppose that and
124 Event : node successfully accepts a color in current phase We want to compute the probability of: We will prove that is at least constant
125 Event : node successfully picks and then accepts color (available color)
126 Note that the events and are mutually exclusive for any pair of colors Any two such events cannot occur simultaneously
127 Success for node in current phase is to successfully accept some color in (available color)
128 since are mutually exclusive
129 Event that node picks randomly color Event that no uncolored neighbor of picks randomly color
130 This holds since and are independent events (the nodes pick randomly their colors independent from one another)
131 Since node picks randomly and uniformly a color from the available colors Probability that node picks color
132 Event that no uncolored neighbor of picks randomly color Event that uncolored neighbor does not pick color
133 This holds because the events are independent
134
135
136 Take any
137 Out of probability space of
138 Thus, we can safely assume that the available palette of is with
139 where
140 We can show that: where and Suppose that
141 We first show: Since is minimum, we have:
142 since
143 Since
144 As needed
145 Therefore, if then
146 Therefore, if then Thus, we can safely assume that the Available palette of is with The available colors of Have been reduced by one
147 Thus, node can repeatedly reduce the available colors in its palette until it consists of 2 available colors A similar observation holds for any node
148 Similarly, any node will reduce the available colors in its palette until it consists of 2 colors
149 Therefore, But assume that for any Available colors:
150 Palette of node Available colors
151 Palette of node Color overlaps with palettes of neighbors
152 Palette of node :number of incoming arrows for a color
153 Palette of node Since, and Average :
154
155 Let be the number of colors with We have that Colors exceeding average Which implies:
156 Since chooses its colors randomly and uniformly in,
157 Suppose that a color has there are at most two neighbors that may choose color say
158 Probability of success for node in current phase constant
159 we need phases for success of all nodes Since a node succeeds with constant probability in a phase Since time duration of a phase is constant, total time needed is