Lecture10 LocalAlgorithms
Lecture10 LocalAlgorithms
Algorithms
1
Distributed Graph Algorithms
• Network graph
• Every is a processor
• Unique identifier
• Knows neighbors
• Synchronous rounds:
1. Send messages to neighbors
2. Receive messages from neighbors
3. Transition to next state
Main Question
• What can we do with local knowledge?
3
Distributed Network Models
LOCAL model:
#rounds or
Distributed Network Models
CONGEST model: Example:
#bits / round Neighbors = bits
Today
LOCAL algorithms:
• Cole-Vishkin 3-coloring algorithm for trees
• Extension to general graphs
• Lower bound for 3-coloring a path
• Luby’s algorithm for maximal independent set
• Reduction from coloring
• Reduction from maximal matching
6
The LOCAL Model
• What is “trivial”?
7
Distributed Coloring
8
Cole-Vishkin Coloring Algorithm
• Assume is a rooted tree:
times
• Initially: “colors”
• One step of Cole-Vishkin: colors colors
9
Color Reduction
• Initial colors
• For each (in parallel): 𝑐 ( 𝑢 )=1010100011
• Announce
• Receive where ’s parent 𝑐 ( 𝑣 ) =1010 0 00011
• Examine in binary:
• Find rightmost index where
colors colors
• For the root:
• Why is this a valid coloring?
10
Color Reduction
• Initial colors
• For each (in parallel): 𝑐 ( 𝑢 )=1010100011
• Announce
• Receive where ’s parent 𝑐 ( 𝑣 ) =1010 0 00011
• Examine in binary:
• Find rightmost index where
colors colors
• For the root:
• Why is this a valid coloring?
• When should we stop?
11
Linear Color Reduction
Eliminate one color in one round:
1. Shift colors down Choose new color from
12
Linear Color Reduction
Eliminate one color in one round:
1. Shift colors down Choose new color from
2. Eliminate color :
If , choose new
color
valid -coloring
13
Linear Color Reduction
Eliminate one color in one round:
1. Shift colors down Choose new color from
2. Eliminate color :
If , choose new
color
valid -coloring
14
Coloring Rooted Trees
• Cole-Vishkin: rounds, colors 6 colors
• Linear color reduction: 3 rounds, 6 colors 3 colors
15
Coloring Arbitrary Graphs
• What can we hope for?
• Computing the chromatic number : NP-hard
• Brook’s Theorem: (except clique or odd cycle)
• Greedy algorithm: colors
16
Coloring Arbitrary Graphs
1. Partition into rooted forests
2. 3-color all forests in parallel using Cole-Vishkin
3. Merge forests sequentially
17
Partitioning Into Rooted Forests
• Each numbers its edges
4 1
1 2
2 3 3
3 2 1
2
3 3
1 2
1
18
Partitioning Into Rooted Forests
• Each numbers its edges
• Orient each edge from smaller ID to larger ID
4 1
1 2
2 3 3
3 2 1
2
3 3
1 2
1
19
Partitioning Into Rooted Forests
• Each numbers its edges
• Orient each edge from smaller ID to larger ID
4 1
1 2
2 3 3
3 2 2 1
3 3
1 2
1
20
Partitioning Into Rooted Forests
• Each numbers its edges
• Orient each edge from smaller ID to larger ID
• Forest = outgoing edges numbered
4 1
1 2
2 3 3
3 2 2 1
3 3
1 2
1
21
Partitioning Into Rooted Forests
4
• Each numbers its edges
• Orient each edge from smaller ID to larger ID
• Forest = outgoing edges numbered
1 3
2 3
3
2
1
22
Step 2: Apply Cole-Vishkin
4
• 3-color each forest
1 3
2 3
3
2
1
23
Step 2: Apply Cole-Vishkin
4
• 3-color each forest
1 3
2 3
3
2
1
24
Step 3: Merge
4
• Sequentially merge + recolor each tree
1 3
2 3
3
2
1
25
One Merging Step:
• Ingredients:
• is -colored
• is -colored
1
2
2
1
26
One Merging Step:
• Ingredients:
is a valid
• : valid coloring for
-coloring for
• : valid coloring for
Reduce to colors
1
2
2
1
27
Color Reduction (Again)
• Before:
• Rooted tree
• Down to 3 colors
• Now:
• Arbitrary graph
• Down to colors
28
Color Reduction (Again)
• Start with coloring where
• Create coloring :
• If , set
• If , set to some free color in
• Why is valid?
29
The Entire Algorithm
1. Partition into forests
2. In parallel: color each using Cole-Vishkin
3. For each :
• Merge into :
• Start from “product coloring”
• Reduce to colors
30
Lower Bound for Coloring
• Linial ‘92: 3-coloring the ring requires rounds
• We’ll show it for paths
31
Normal Form
• What does a LOCAL algorithm do on a path?
32
Coloring Functions
• -ary -coloring:
• Mapping
• For any :
33
Lower Bound Outline
1. There is no -ary -coloring with .
2. If there is a -ary -coloring, then there is a -ary -coloring.
34
1-Ary Colorings
• -ary -coloring:
• Mapping
• For any :
• Fix , where
35
Round Reduction
• Fix
• Construct :
• Is this valid?
• Suppose not:
• Let
• Then
• So
• Contradiction to the validity of
36
Luby’s MIS Algorithm
37
Maximal Independent Set (MIS)
• Independent set: , such that
• Sequential algorithm:
38
Luby’s Algorithm
Initially:
• , all nodes are active
Repeat “until done”: in parallel for all ,
• Select
• Send to all neighbors
• If for all :
• Add to
• Announce to all neighbors
• If has neighbor : inactivate
39
Basic Fact
• When :
40
How Does Luby Make Progress?
41
Expected Running Time
• kills : if 𝑤
𝑢 𝑣
• Problem with this approach?
42
Expected Running Time
• single-handedly kills : 𝑤
if
𝑢 𝑣
43
Number of S.H.-Killing Events
1
deg ( 𝑢 ) +deg ( 𝑤 )
44
Expected Running Time
• Let #edges after round
•…
45
Reduction from -Coloring to MIS
• What is a “reduction” from to ?
• Given efficient algorithm for
• Construct efficient’ algorithm for
• We want:
• Given local algorithm for MIS
• Construct local’ algorithm for -coloring
46
Reduction from -Coloring to MIS
𝑣
𝑣
Simulate MIS
Vertex Clique: algorithm
What do to with
the output?
𝑢 𝑣
𝑢 𝑣
Edge Bi-clique:
Output:
• In every “node clique”, at least one color MIS Color()=unique color in ’s
clique in the MIS
𝑢
≤Δ
49
Reduction from Maximal Matching to MIS
• Claim: MIS in the line graph = maximal matching
• Line graph :
• Vertices:
• Edges: share an endpoint
• If is an MIS for :
• is a matching: share endpoint neighbors
in
• is maximal: some neighbor
50
END (LOCAL MODEL)
51