1) The document describes algorithms for solving the maximum flow and electrical flow problems on graphs.
2) It introduces the multiplicative weight update method, which can be used to find an approximate maximum flow in Oε(m3/2) time by reducing the problem to approximating electrical flows.
3) The algorithm works by having the "follower" maintain a distribution over edges using MWU based on "money" or congestion values revealed by approximate electrical flow computations.
1. Max Flows & Electrical Flows
Thatchaphol Saranurak
2 July 2014
1
2. Motivation
• Recently, there are many fast algorithms
• Max flow, Multi-commodity flow, Oblivious Routing, Sparsest Cut, Computing eigenvector,…
• Since we can solve approx. electrical flow in 𝑂𝜖 𝑚
• Example: Exact Max Flow (unit capacities)
• 𝑂 𝑚1.43 [Madry13]
• First improvement (over sparse graph case) in last ≈40 years!
• 𝑂 min{𝑚3/2, 𝑚𝑛2/3} [ET75]
Notation
• 𝑂 ⋅ hides 𝑝𝑜𝑙𝑦𝑙𝑜𝑔
• 𝑂𝜖 ⋅ also hides 𝜖
2
3. Goal
• Will see 2 results with simple analysis in this line of research
1. [CKMST11] 𝜖-approx. Max Flow in 𝑂𝜖 𝑚4/3
• (will focus on 𝑂𝜖 𝑚3/2 )
2. [KOSZ13] 𝜖-approx. Electrical Flow in 𝑂𝜖 𝑚
Notation
• 𝑂 ⋅ hides 𝑝𝑜𝑙𝑦𝑙𝑜𝑔
• 𝑂𝜖 ⋅ also hides 𝜖
3
8. Max Flow Problem
• Solution: s-t flow 𝑓 of 𝑐𝑜𝑛𝑔 𝑓 ≤ 1
• Note: Here we consider only s-t flow just for simplicity.
• Goal: max
𝑓
𝑣𝑎𝑙𝑢𝑒(𝑓)
8
9. Resistance & Energy
• Resistance 𝑟: 𝐸 → ℝ+
• Energy
• ℰ 𝑓 (𝑒) = 𝑟(𝑒)𝑓(𝑒)2
• Note: called “Power” in physics: 𝑃 = 𝑅𝐼2
• ℰ 𝑓 = 𝑒 ℰ 𝑓 𝑒 = 𝑒 𝑟(𝑒)𝑓(𝑒)2
• 𝑅: a diagonal matrix with 𝑅 𝑒,𝑒 = 𝑟 𝑒 : R =
𝑟(𝑒1) ⋯ 0
⋮ ⋱ ⋮
0 ⋯ 𝑟(𝑒 𝑚)
• So ℰ(𝑓) = 𝑓 𝑇
𝑅𝑓
9
10. Electrical Flow Problem
• Solution: s-t flow 𝑓 of 𝑣𝑎𝑙𝑢𝑒 𝑓 = 𝐹, for a given 𝐹
• Goal: min
𝑓
ℰ(𝑓) = 𝑓 𝑇 𝑅𝑓
• Electrical Flow ≡ Min Energy Flow.
• Note: don’t care about capacity here.
10
11. Approx. Flow
• 𝑓 is 𝜖-approx. Max flow
• Suppose 𝑓∗
is Max flow:
• 𝜖-approx: 𝑣𝑎𝑙𝑢𝑒 𝑓 ≥ 1 − 𝜖 𝑣𝑎𝑙𝑢𝑒 𝑓∗
• Feasible: 𝑐𝑜𝑛𝑔 𝑓 , 𝑐𝑜𝑛𝑔 𝑓∗ ≤ 1
• 𝑓 is 𝜖-approx. Electrical flow (of fixed value 𝐹)
• Suppose 𝑓∗ is electrical flow:
• 𝜖-approx: ℰ(𝑓) < (1 + 𝜖)ℰ(𝑓∗)
• Feasible: s-t flow with 𝑣𝑎𝑙𝑢𝑒 𝑓 , 𝑣𝑎𝑙𝑢𝑒 𝑓∗ = 𝐹
11
12. High Level: Max Flow via Electrical Flow
• Black Box: approx. Electrical Flow in 𝑂𝜖(𝑚) time
Approx
Max
Flows
Approx
Electrical
Flows
Multiplicative Weight Update
𝑜 𝜖( 𝑚) turns
First method to solve approx. max flow in 𝑜𝜖(𝑚3/2) time
Oracle
12
13. Multiplicative Weight Update (MWU)
Preliminaries
Multiplicative Weight Update
MWU for Max Flow
Geometry of Electrical Flow
Alternating Projection Method
13
14. Scenario
• 𝑛 experts and Follower gaining money in turn
• Each turn 𝑡,
1. Follower chooses dist. 𝒑(𝑡) = (𝑝1
𝑡
, … , 𝑝 𝑛
𝑡
) over experts:
“which guy to follow”
2. Oracle reveals: expert 𝑖 gain money 𝑚𝑖
(𝑡)
∈ [0, 𝜌].
(Choose 𝑝𝑖
𝑡
before knowing 𝑚𝑖
(𝑡)
)
3. Follower gains 𝒎(𝑡)
𝒑(𝑡)
= 𝑖 𝑚𝑖
(𝑡)
𝑝𝑖
𝑡
• Goal: Maximize Follower’s total gain: 𝑡 𝒎(𝑡) 𝒑(𝑡)
14
15. Good Strategy for Follower
• Intuition: “Give more credit to experts who gain a lot”
• 𝑤𝑖
(𝑡)
= 𝑤𝑖
𝑡−1
(1 + 𝜂𝑚𝑖
𝑡−1
)
• Init: 𝑤𝑖
(1)
= 1 for all expert 𝑖
• Not too fast: 𝜂 ≤
1
𝜌
⇒ 𝜂𝑚𝑖
𝑡
≤ 1. (𝑚𝑖
𝑡
∈ 0, 𝜌 )
• 𝒑(𝑡) ∝ 𝒘(𝑡)
• Theorem: after 𝑇 turns,
𝑡=1
𝑇
𝒎(𝑡)
𝒑(𝑡)
≥ 1 − 𝜂𝜌 𝑡=1
𝑇
𝑚𝑖
𝑡
−
ln 𝑛
𝜂
∀𝑖
15
16. Interpretation (Not precise)
𝑡=1
𝑇
𝒎 𝑡
𝒑 𝑡
𝑇
≥ 1 − 𝜂𝜌
𝑡=1
𝑇
𝑚𝑖
𝑡
𝑇
−
ln 𝑛
𝜂𝑇
• Set 𝜂𝜌 = 𝜖 and 𝑇 ≈
ln 𝑛
𝜂𝜖
= 𝑂(
𝜌 ln 𝑛
𝜖2 ) (can neglect
ln 𝑛
𝜂𝑇
≈ 𝜖)
• Average gain of follower≥ (1 − 𝜖) Average gain of expert 𝑖
• Average gain of expert 𝑖 ≤ (1 + 𝜖) Average gain of follower
• Look another way (will use this)
16
17. Optimizing without Thinking: Study history
• Take home message about MWU…
• Even if the future is completely unpredictable,
• In long run (about total gain)…
• “Blindly following the vote of experts with good records”
• Already gives you ≈ gain of the best expert.
17
18. MWU for Max Flow
Preliminaries
Multiplicative Weight Update
MWU for Max Flow
Geometry of Electrical Flow
Alternating Projection Method
18
19. Reduce the task
• Task: find 𝑓 with 𝑣𝑎𝑙𝑢𝑒 𝑓 = 1 − 𝑂 𝜖 𝐹, 𝑐𝑜𝑛𝑔 𝑓 ≤ 1
• For fixed 𝐹
• Can find O(𝜖)-approx. Max flow 𝑓
• Spend log factor more time, by binary search on 𝐹
19
20. The Algorithm: Money as Congestion
• Expert 𝑖: edge 𝑒𝑖
• Follower: maintain 𝒑(𝑡) using the “Good Strategy”
• Oracle: each turn 𝑡,
• Compute: (
𝜖
3
)-approx. electrical flow 𝑓𝑡 = 𝑓𝑡(𝒑(𝑡))
• Resistance 𝑟(𝑒𝑖) depends on 𝑝𝑖
(𝑡)
(will specify)
• 𝑣𝑎𝑙𝑢𝑒(𝑓𝑡) = 𝐹
• Reveal: expert 𝑖 gain money 𝑚𝑖
(𝑡)
= 𝑐𝑜𝑛𝑔 𝑓𝑡
𝑒𝑖 , for each edge 𝑒𝑖.
20
21. The Algorithm: Scaled Average Flow
• After 𝑇 = 𝑂(
𝜌 ln 𝑚
𝜖2 ) turns
• 𝑓 = 𝑡=1
𝑇
𝑓𝑡 /𝑇 is an average flow
• Return 𝑓/(1 + 𝜖)2
• Runtime: 𝑂 𝑚𝑇 = 𝑂 𝑚
𝜌
𝜖2 . (Will bound 𝜌 = 𝑂( 𝑚/𝜖).)
21
22. Correctness
• 𝑐𝑜𝑛𝑔 𝑓 𝑒𝑖 = Average gain of expert 𝑖
• Will show: Average gain of follower≤ 1 + 𝜖
• 𝑐𝑜𝑛𝑔 𝑓 𝑒𝑖 ≤ 1 + 𝜖 2
• As, Average gain of expert 𝑖 ≤ (1 + 𝜖) Average gain of follower
• 𝑣𝑎𝑙𝑢𝑒( 𝑓) = 𝐹
• 𝑣𝑎𝑙𝑢𝑒(𝑓𝑡) = 𝐹 for all 𝑡
• So 𝑓/(1 + 𝜖)2
• congestion ≤ 1
• value =
𝐹
1+𝜖 2 = 1 − 𝑂 𝜖 𝐹
22
23. Clever Choice of Resistance
Remain to show
1. Average gain of follower ≤ (1 + 𝜖)
• Will show: for every turn 𝑡, gain of follower 𝒎(𝑡) 𝒑(𝑡) ≤ (1 + 𝜖)
2. Bound 𝜌 = 𝑂( 𝑚/𝜖).
• Upper bound 𝑚𝑖
𝑡
= 𝑐𝑜𝑛𝑔 𝑓𝑡
𝑒𝑖 for all 𝑖, 𝑡
• To show both statements simultaneously,
• At turn 𝑡, set
𝑟 𝑒𝑖 =
1
𝑢 𝑒𝑖
2
(𝑝𝑖
𝑡
+
𝜖
3𝑚
)
23
36. Kirchhoff's Potential Theorem: compact form
• T: spanning tree
• For any e = (a, b) ∈ 𝐸T,
• 𝑃𝑒: unique path in 𝑇 connecting 𝑎 and 𝑏
• 𝑐 𝑒 = 𝑃𝑒 ∪ 𝑒 : a cycle
• 𝑓 is electrical flow ⟺ 𝑓, 𝑐 𝑒 𝑅 = 0 ∀e ∈ 𝐸T
• Proof idea:
• Cycles in graph form an 𝔽2-vector space.
• {𝑐 𝑒 ∣ 𝑒 ∈ 𝐸𝑇} is basis of that 𝔽2-vector space
• hence in our ℝ-vector space as well
36
𝑎
𝑏
𝑒
𝑃𝑒
37. Geometry of Electrical Flow
• Fix spanning tree 𝑇
• 𝑆 𝑒 = {𝑓 ∣ 𝑓, 𝑐 𝑒 𝑅 = 0} : hyper-plane
• for e ∈ 𝐸T
• 𝑓 is electrical flow ⟺ 𝑓, 𝑐 𝑒 𝑅 = 0 ∀e ∈ 𝐸T
• So, the electrical flow 𝑓∗
of value 𝐹
• = ( e∈𝐸T 𝑆 𝑒) ∩ {𝑓 ∣ 𝐵 𝑇 𝑓∗ = 𝜒}
37
𝑓∗
{𝑓| 𝑓, 𝑐1 𝑅 = 0}
{𝑓| 𝑓, 𝑐2 𝑅 = 0}
38. Alternating Projection Method
How to find approx. Electrical Flow in near linear time
38
Preliminaries
Multiplicative Weight Update
MWU for Max Flow
Geometry of Electrical Flow
Alternating Projection Method
39. Overview
• 𝑓∗ = ( e∈𝐸T 𝑆 𝑒) ∩ {𝑓 ∣ 𝐵 𝑇 𝑓∗ = 𝜒}
• High-Level Idea
• Start from some flow 𝑓0 (which is not too bad)
• 𝑓𝑖+1 ← 𝑓𝑖 “projected” on some 𝑆 𝑒 (so 𝑓𝑖+1, 𝑐 𝑒 𝑅 = 0)
• Repeat…
39
𝑓∗
{𝑓| 𝑓, 𝑐1 𝑅 = 0}
{𝑓| 𝑓, 𝑐2 𝑅 = 0}𝑓0
𝑓1
𝑓2
• Question (to be answered)
1. Which spanning tree 𝑇: Low-stretch spanning tree
2. Which initial flow 𝑓0: Flow restricted in 𝑇
3. Fast projection: Link-cut tree
4. How many projections: ∼ 𝜏 𝑇 in expectation
40. Stretch of Edge in Tree
• T: spanning tree
• For any e = (a, b) ∈ 𝐸T,
• 𝑃𝑒: unique path in 𝑇 connecting 𝑎 and 𝑏
• 𝑐 𝑒 = 𝑃𝑒 ∪ 𝑒 : a cycle
• 𝑠𝑡 𝑒 =
𝑒′∈𝑃 𝑒
𝑟 𝑒′
𝑟𝑒
=
𝑃𝑒 𝑅
2
𝑟𝑒
• 𝑠𝑡 𝑒 + 1 =
𝑒′∈𝑃 𝑒
𝑟 𝑒′
𝑟𝑒
+
𝑟𝑒
𝑟𝑒
=
𝑒′∈𝑐 𝑒
𝑟 𝑒′
𝑟𝑒
=
𝑐 𝑒 𝑅
2
𝑟𝑒
40
𝑎
𝑏
𝑒
𝑃𝑒
41. Low Stretch Spanning Tree
• Stretch: 𝑠𝑡 𝑇 = 𝑒∈𝐸
𝑃𝑒 𝑅
2
𝑟𝑒
• Condition number: 𝜏 𝑇 = 𝑒∈𝐸T
𝑐 𝑒 𝑅
2
𝑟𝑒
• Almost same: 𝜏(𝑇) = 𝑠𝑡(𝑇) + Θ(𝑚)
• [Abraham Neiman ’12] Can find spanning tree 𝑇
• with st(𝑇) = 𝑂(𝑚 log 𝑛 log log 𝑛)
• in time 𝑂(𝑚 log 𝑛 log log 𝑛) (not bottleneck)
• 𝜏 𝑇 , 𝑠𝑡 𝑇 determine efficiency of the algorithm
41
42. Initial Flow 𝑓0
• 𝑇: Low stretch spanning tree
• 𝑓0: Unique flow restricted to 𝑇
• Can compute fast in 𝑂(𝑛) time
• Theorem: 𝑓0 − 𝑓∗
𝑅
2
≤ 𝑠𝑡(𝑇) 𝑓∗
𝑅
2
• Not too far from 𝑓∗
42
43. Overview
• 𝑓∗ = e∈𝐸T {𝑓 ∣ 𝑓, 𝑐 𝑒 𝑅 = 0}
• High-Level Idea
• Start from some flow 𝑓0 (which is not too bad)
• 𝑓𝑖+1 ← 𝑓𝑖 “projected” on some 𝑆 𝑒 (so 𝑓𝑖+1, 𝑐 𝑒 𝑅 = 0)
• Repeat…
43
𝑓∗
{𝑓| 𝑓, 𝑐1 𝑅 = 0}
{𝑓| 𝑓, 𝑐2 𝑅 = 0}𝑓0
𝑓1
𝑓2
• Question (to be answered)
1. Which spanning tree 𝑇: Low-stretch spanning tree
2. Which initial flow 𝑓0: Flow restricted in 𝑇
3. Fast projection: Link-cut tree
4. How many projections: ∼ 𝜏 𝑇 in expectation
46. Implement Circulation around 𝑐 𝑒
• Can do in 𝑂 log 𝑛 = 𝑂(1) time
1. Update flow at 𝑒
2. Update flow at 𝑃𝑒
• 𝑃𝑒 can have Θ(𝑛) edges
• Link-Cut Tree will do (more than enough!)
• Link-Cut Tree: for maintaining value of any path 𝑃 ⊂ 𝑇 (another tree)
• Query min/max/sum of value of 𝑃
• Add/reduce value of each edge in 𝑃
• Link/cut edge of the tree itself (did not use here)
• Everything in 𝑂 log 𝑛 time
46
𝑎
𝑏
𝑒
𝑃𝑒
47. Overview
• 𝑓∗ = e∈𝐸T {𝑓 ∣ 𝑓, 𝑐 𝑒 𝑅 = 0}
• High-Level Idea
• Start from some flow 𝑓0 (which is not too bad)
• 𝑓𝑖+1 ← 𝑓𝑖 “projected” on some 𝑆 𝑒 (so 𝑓𝑖+1, 𝑐 𝑒 𝑅 = 0)
• Repeat…
47
𝑓∗
{𝑓| 𝑓, 𝑐1 𝑅 = 0}
{𝑓| 𝑓, 𝑐2 𝑅 = 0}𝑓0
𝑓1
𝑓2
• Question (to be answered)
1. Which spanning tree 𝑇: Low-stretch spanning tree
2. Which initial flow 𝑓0: Flow restricted in 𝑇
3. Fast projection: Link-cut tree
4. How many projections: ∼ 𝜏 𝑇 in expectation
48. Progress in Projection
• 𝑓𝑡+1 − 𝑓∗
𝑅
2
= 𝑓𝑡 − 𝑓∗
𝑅
2
− 𝑓𝑡+1 − 𝑓𝑡 𝑅
2
Progress≥0
• Pythagorean: 𝑓𝑡+1 − 𝑓∗
and 𝑓𝑡+1 − 𝑓𝑡 are orthogonal
• The best 𝑆 𝑒, over 𝑒 ∈ 𝐸𝑇, maximizes 𝑓𝑡+1 − 𝑓𝑡 𝑅
• Don't know how to choose a good one fast…
• Random is good enough!
• Appropriate distribution
48
𝑐 𝑒
𝑆 𝑒
𝑓𝑡
𝑓𝑡+1
𝑓∗
49. Random projection
• Project to 𝑆 𝑒 with prob. 𝑝 𝑒 =
𝑐 𝑒 𝑅
2
𝑟𝑒
• Recall: 𝜏 𝑇 = 𝑒∈𝐸T
𝑐 𝑒 𝑅
2
𝑟𝑒
• Oblivious: do not care where we are now
• Theorem: 𝔼 𝑔, 𝑐 𝑒 𝑅 ≥
𝑔 𝑅
2
𝜏 𝑇
for any circulation 𝑔
• Progress: 𝑓𝑡+1 − 𝑓𝑡 𝑅 = 𝑓𝑡 , 𝑐 𝑒 𝑅 − 𝑓∗
, 𝑐 𝑒 𝑅
0
= 𝑓𝑡 − 𝑓∗
, 𝑐 𝑒 𝑅
• Expect: 𝔼 𝑓𝑡+1 − 𝑓𝑡 𝑅 = 𝔼 𝑓𝑡 − 𝑓∗, 𝑐 𝑒 𝑅 ≥
1
𝜏 𝑇
𝑓𝑡 − 𝑓∗
𝑅
2
49
𝑐 𝑒
𝑆 𝑒
𝑓𝑡
𝑓𝑡+1
𝑓∗
52. Total Runtime
1. Find low-stretch spanning tree 𝑇 in time 𝑂 𝑚 log 𝑛 log log 𝑛
2. Find 𝑓0 restricted to 𝑇 in time 𝑂(𝑛)
3. Repeat 𝜏 𝑇 log
𝑠𝑡 𝑇
𝜖
times
• 𝑓𝑖+1 ← 𝑓𝑖 “projected” on some 𝑆 𝑒 in time 𝑂(log 𝑛)
• Total runtime: 𝑂 𝜏 𝑇 log
1
𝜖
= 𝑂 𝑚 log
1
𝜖
52
𝑓∗
{𝑓| 𝑓, 𝑐1 𝑅 = 0}
{𝑓| 𝑓, 𝑐2 𝑅 = 0}𝑓0
𝑓1
𝑓2
53. Summary
1. Approx. Max Flow in 𝑂𝜖 𝑚1.5
(with small fix to get 𝑂𝜖 𝑚1.33..
)
2. Approx. Electrical Flow in 𝑂𝜖 𝑚
Preliminaries
Multiplicative Weight Update
MWU for Max Flow
Geometry of Electrical Flow
Alternating Projection Method
53
60. Solving Laplacian System ≡ Finding Electrical Flow
• Same run time for exact solution
• Almost same run time in approx. solution
• Note: did not define “approx. solution of Laplacian System”
60