Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
[ACM-ICPC] Minimum Cut
Search
KuoE0
January 21, 2013
Programming
2
100
[ACM-ICPC] Minimum Cut
KuoE0
January 21, 2013
Tweet
Share
More Decks by KuoE0
See All by KuoE0
Protocol handler in Gecko
kuoe0
0
82
面試面試面試,因為很重要所以要說三次!
kuoe0
2
220
應徵軟體工程師
kuoe0
0
150
面試心得分享
kuoe0
0
400
Windows 真的不好用...
kuoe0
0
260
Python @Wheel Lab
kuoe0
0
190
Introduction to VP8
kuoe0
0
220
Python @NCKU_CSIE
kuoe0
0
100
[ACM-ICPC] Tree Isomorphism
kuoe0
1
230
Other Decks in Programming
See All in Programming
Moscow Python Meetup №97. Константин Крестников (Техлид команды GigaChain (SberDevices)). GigaChain: Новые инструменты для разработки агентов на примере агента техподдержки
moscowdjango
PRO
0
100
Lookerは可視化だけじゃない。UIコンポーネントもあるんだ!
ymd65536
1
140
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
190
SRE、開発、QAが協業して挑んだリリースプロセス改革@SRE Kaigi 2025
nealle
1
3.3k
Linux && Docker 研修/Linux && Docker training
forrep
22
4.1k
『改訂新版 良いコード/悪いコードで学ぶ設計入門』活用方法−爆速でスキルアップする!効果的な学習アプローチ / effective-learning-of-good-code
minodriven
29
4.8k
Terraform で作る Amazon ECS の CI/CD パイプライン
hiyanger
0
110
自動で //nolint を挿入する取り組み / Gopher's Gathering
utgwkk
1
170
Amazon Bedrock Multi Agentsを試してきた
tm2
1
240
ASP. NET CoreにおけるWebAPIの最新情報
tomokusaba
0
220
Kanzawa.rbのLT大会を支える技術の裏側を変更する Ruby on Rails + Litestream 編
muryoimpl
0
120
Flatt Security XSS Challenge 解答・解説
flatt_security
0
1.1k
Featured
See All Featured
Unsuck your backbone
ammeep
669
57k
Producing Creativity
orderedlist
PRO
343
39k
Building an army of robots
kneath
302
45k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Scaling GitHub
holman
459
140k
Optimising Largest Contentful Paint
csswizardry
33
3k
The World Runs on Bad Software
bkeepers
PRO
67
11k
Building Your Own Lightsaber
phodgson
104
6.2k
VelocityConf: Rendering Performance Case Studies
addyosmani
327
24k
The Language of Interfaces
destraynor
156
24k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.3k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
Transcript
Minimum Cut ֲࢸݢʢKuoE0ʣ
[email protected]
KuoE0.ch
Cut
cut (undirected)
1 3 5 6 7 8 9 2 4 undirected
graph A partition of the vertices of a graph into two disjoint subsets
1 3 5 6 7 8 9 2 4 undirected
graph A partition of the vertices of a graph into two disjoint subsets
1 3 5 6 7 8 9 2 4 undirected
graph A partition of the vertices of a graph into two disjoint subsets
1 2 8 5 4 7 9 3 6 A
partition of the vertices of a graph into two disjoint subsets undirected graph
1 2 8 5 4 7 9 3 6 Cut-set
of the cut is the set of edges whose end points are in different subsets. undirected graph
1 2 8 5 4 7 9 3 6 Cut-set
of the cut is the set of edges whose end points are in different subsets. Cut-set undirected graph
1 2 8 5 4 7 9 3 6 weight
= number of edges or sum of weight on edges weight is 7 undirected graph
cut (directed)
1 3 5 6 7 8 9 2 4 directed
graph A partition of the vertices of a graph into two disjoint subsets
1 3 5 6 7 8 9 2 4 directed
graph A partition of the vertices of a graph into two disjoint subsets
1 3 5 6 7 8 9 2 4 directed
graph A partition of the vertices of a graph into two disjoint subsets
1 2 8 5 4 7 9 3 6 directed
graph A partition of the vertices of a graph into two disjoint subsets
1 2 8 5 4 7 9 3 6 directed
graph Cut-set of the cut is the set of edges whose end points are in different subsets.
1 2 8 5 4 7 9 3 6 directed
graph Cut-set of the cut is the set of edges whose end points are in different subsets.
1 2 8 5 4 7 9 3 6 Cut-set
directed graph Cut-set of the cut is the set of edges whose end points are in different subsets.
1 2 8 5 4 7 9 3 6 weight
is 5⇢ or 2⇠ directed graph weight = number of edges or sum of weight on edges
s-t cut 1. one side is source 2. another side
is sink 3. cut-set only consists of edges going from source’s side to sink’s side
1 3 5 6 7 8 9 2 4 flow
network Source Sink Other
1 3 5 6 7 8 9 2 4 flow
network Source Sink
1 3 5 6 7 8 9 2 4 flow
network Source Sink
1 2 8 5 4 7 9 3 6 flow
network cut-set only consists of edges going from source’s side to sink’s side
1 2 8 5 4 7 9 3 6 weight
is 6 flow network cut-set only consists of edges going from source’s side to sink’s side
Max-Flow Min-Cut Theorem
Observation 1 The network flow sent across any cut is
equal to the amount reaching sink. 1 3 2 4 5 6 3/3 3/8 4/4 2/2 1/4 4/4 2/3 total flow = 6, flow on cut = 3 + 3 = 6
Observation 1 The network flow sent across any cut is
equal to the amount reaching sink. 1 3 2 4 5 6 3/3 3/8 4/4 2/2 1/4 4/4 2/3 total flow = 6, flow on cut = 3 + 3 = 6
Observation 1 The network flow sent across any cut is
equal to the amount reaching sink. 1 3 2 4 5 6 3/3 3/8 4/4 2/2 1/4 4/4 2/3 total flow = 6, flow on cut = 3 + 4 - 1 = 6
Observation 1 The network flow sent across any cut is
equal to the amount reaching sink. 1 3 2 4 5 6 3/3 3/8 4/4 2/2 1/4 4/4 2/3 total flow = 6, flow on cut = 3 + 4 - 1 = 6
Observation 1 The network flow sent across any cut is
equal to the amount reaching sink. 1 3 2 4 5 6 3/3 3/8 4/4 2/2 1/4 4/4 2/3 total flow = 6, flow on cut = 4 + 2= 6
Observation 1 The network flow sent across any cut is
equal to the amount reaching sink. 1 3 2 4 5 6 3/3 3/8 4/4 2/2 1/4 4/4 2/3 total flow = 6, flow on cut = 4 + 2= 6
Observation 1 The network flow sent across any cut is
equal to the amount reaching sink. 1 3 2 4 5 6 3/3 3/8 4/4 2/2 1/4 4/4 2/3 total flow = 6, flow on cut = 4 + 2= 6
Observation 1 The network flow sent across any cut is
equal to the amount reaching sink. 1 3 2 4 5 6 3/3 3/8 4/4 2/2 1/4 4/4 2/3 total flow = 6, flow on cut = 4 + 2= 6
Observation 2 Then the value of the flow is at
most the capacity of any cut. 1 3 2 4 5 6 3 8 4 2 4 4 3 It’s trivial!
Observation 2 Then the value of the flow is at
most the capacity of any cut. 1 3 2 4 5 6 3 8 4 2 4 4 3 It’s trivial!
Observation 3 Let f be a flow, and let (S,T)
be an s-t cut whose capacity equals the value of f. 1 3 2 4 5 6 3/3 3/8 4/4 2/2 1/4 4/4 2/3 f is the maximum flow (S,T) is the minimum cut
Observation 3 Let f be a flow, and let (S,T)
be an s-t cut whose capacity equals the value of f. 1 3 2 4 5 6 3/3 3/8 4/4 2/2 1/4 4/4 2/3 f is the maximum flow (S,T) is the minimum cut
Max-Flow EQUAL Min-Cut
Example
1 3 2 4 5 6 3 8 4 2
4 4 3
1 3 2 4 5 6 3/3 3/8 4/4 2/2
1/4 4/4 2/3 Maximum Flow = 6
1 3 2 4 5 6 0/3 5/8 0/4 0/2
3/4 0/4 1/3 Residual Network
1 3 2 4 5 6 0/3 5/8 0/4 0/2
3/4 0/4 1/3 Minimum Cut = 6
1 3 2 4 5 6 0/3 5/8 0/4 0/2
3/4 0/4 1/3 Minimum Cut = 6
1 3 2 4 5 6 0/3 5/8 0/4 0/2
3/4 0/4 1/3 Minimum Cut = 6
1 3 2 4 5 6 0/3 5/8 0/4 0/2
3/4 0/4 1/3 Minimum Cut = 6
The minimum capacity limit the maximum flow!
find a s-t cut
1 3 2 4 5 6 3/3 3/8 4/4 2/2
1/4 4/4 2/3 Maximum Flow = 6
1 3 2 4 5 6 0/3 5/8 0/4 0/2
3/4 0/4 1/3 Travel on Residual Network
1 3 2 4 5 6 0/3 5/8 0/4 0/2
3/4 0/4 1/3 start from source
1 3 2 4 5 6 0/3 5/8 0/4 0/2
3/4 0/4 1/3 don’t travel through full edge
1 3 2 4 5 6 0/3 5/8 0/4 0/2
3/4 0/4 1/3 don’t travel through full edge
1 3 2 4 5 6 0/3 5/8 0/4 0/2
3/4 0/4 1/3 no residual edge
1 3 2 4 5 6 0/3 5/8 0/4 0/2
3/4 0/4 1/3 no residual edge
1 3 2 4 5 6 0/3 5/8 0/4 0/2
3/4 0/4 1/3 s-t cut
1 3 2 4 5 6 0/3 5/8 0/4 0/2
3/4 0/4 1/3 s-t cut
result of starting from sink 1 3 2 4 5
6 0/3 5/8 0/4 0/2 3/4 0/4 1/3
result of starting from sink 1 3 2 4 5
6 0/3 5/8 0/4 0/2 3/4 0/4 1/3
Minimum cut is non-unique!
time complexity: based on max-flow algorithm Ford-Fulkerson algorithm O(EF) Edmonds-Karp
algorithm O(VE2) Dinic algorithm O(V2E)
Stoer Wagner only for undirected graph time complexity: O(N3) or
O(N2log2N)
UVa 10480 - Sabotage Practice Now
Problem List UVa 10480 UVa 10989 POJ 1815 POJ 2914
POJ 3084 POJ 3308 POJ 3469
Reference • http://www.flickr.com/photos/dgjones/335788038/ • http://www.flickr.com/photos/njsouthall/3181945005/ • http://www.csie.ntnu.edu.tw/~u91029/Cut.html • http://en.wikipedia.org/wiki/Cut_(graph_theory) •
http://en.wikipedia.org/wiki/Max-flow_min-cut_theorem • http://www.cs.princeton.edu/courses/archive/spr04/cos226/lectures/ maxflow.4up.pdf • http://www.cnblogs.com/scau20110726/archive/ 2012/11/27/2791523.html
Thank You for Your Listening.