Upgrade to Pro — share decks privately, control downloads, hide ads and more …

[ACM-ICPC] Minimum Cut

KuoE0
January 21, 2013

[ACM-ICPC] Minimum Cut

KuoE0

January 21, 2013
Tweet

More Decks by KuoE0

Other Decks in Programming

Transcript

  1. Cut

  2. 1 3 5 6 7 8 9 2 4 undirected

    graph A partition of the vertices of a graph into two disjoint subsets
  3. 1 3 5 6 7 8 9 2 4 undirected

    graph A partition of the vertices of a graph into two disjoint subsets
  4. 1 3 5 6 7 8 9 2 4 undirected

    graph A partition of the vertices of a graph into two disjoint subsets
  5. 1 2 8 5 4 7 9 3 6 A

    partition of the vertices of a graph into two disjoint subsets undirected graph
  6. 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
  7. 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
  8. 1 2 8 5 4 7 9 3 6 weight

    = number of edges or sum of weight on edges weight is 7 undirected graph
  9. 1 3 5 6 7 8 9 2 4 directed

    graph A partition of the vertices of a graph into two disjoint subsets
  10. 1 3 5 6 7 8 9 2 4 directed

    graph A partition of the vertices of a graph into two disjoint subsets
  11. 1 3 5 6 7 8 9 2 4 directed

    graph A partition of the vertices of a graph into two disjoint subsets
  12. 1 2 8 5 4 7 9 3 6 directed

    graph A partition of the vertices of a graph into two disjoint subsets
  13. 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.
  14. 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.
  15. 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.
  16. 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
  17. 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
  18. 1 3 5 6 7 8 9 2 4 flow

    network Source Sink Other
  19. 1 3 5 6 7 8 9 2 4 flow

    network Source Sink
  20. 1 3 5 6 7 8 9 2 4 flow

    network Source Sink
  21. 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
  22. 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
  23. 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
  24. 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
  25. 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
  26. 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
  27. 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
  28. 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
  29. 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
  30. 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
  31. 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!
  32. 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!
  33. 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
  34. 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
  35. 1 3 2 4 5 6 3/3 3/8 4/4 2/2

    1/4 4/4 2/3 Maximum Flow = 6
  36. 1 3 2 4 5 6 0/3 5/8 0/4 0/2

    3/4 0/4 1/3 Residual Network
  37. 1 3 2 4 5 6 0/3 5/8 0/4 0/2

    3/4 0/4 1/3 Minimum Cut = 6
  38. 1 3 2 4 5 6 0/3 5/8 0/4 0/2

    3/4 0/4 1/3 Minimum Cut = 6
  39. 1 3 2 4 5 6 0/3 5/8 0/4 0/2

    3/4 0/4 1/3 Minimum Cut = 6
  40. 1 3 2 4 5 6 0/3 5/8 0/4 0/2

    3/4 0/4 1/3 Minimum Cut = 6
  41. 1 3 2 4 5 6 3/3 3/8 4/4 2/2

    1/4 4/4 2/3 Maximum Flow = 6
  42. 1 3 2 4 5 6 0/3 5/8 0/4 0/2

    3/4 0/4 1/3 Travel on Residual Network
  43. 1 3 2 4 5 6 0/3 5/8 0/4 0/2

    3/4 0/4 1/3 start from source
  44. 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
  45. 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
  46. 1 3 2 4 5 6 0/3 5/8 0/4 0/2

    3/4 0/4 1/3 no residual edge
  47. 1 3 2 4 5 6 0/3 5/8 0/4 0/2

    3/4 0/4 1/3 no residual edge
  48. 1 3 2 4 5 6 0/3 5/8 0/4 0/2

    3/4 0/4 1/3 s-t cut
  49. 1 3 2 4 5 6 0/3 5/8 0/4 0/2

    3/4 0/4 1/3 s-t cut
  50. 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
  51. 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
  52. 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