CSCI 4260 MATH 4150 - PowerPoint PPT Presentation

1 / 30
About This Presentation
Title:

CSCI 4260 MATH 4150

Description:

Cuts. In a network, a source/sink cut [S,T] consists of edges from a source set S to ... So the capacity of any flow is bounded by the capacity of the cut. ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 31
Provided by: csR4
Category:
Tags: csci | math

less

Transcript and Presenter's Notes

Title: CSCI 4260 MATH 4150


1
CSCI 4260 MATH 4150
  • Network Flows

2
Last lecture
  • We covered maximum matchings in bipartite graphs.
  • Today
  • Network Flows
  • But first some variations of the matching problem

3
Recap maximum bipartite matching
  • Given a bipartite graph G (X,Y,E)
  • Find a set M of edges
  • No two edges share an endpoint
  • With maximum cardinality
  • We presented an algorithm that searches for
    alternating paths from a given matching M
  • If augmenting path found ? we find a bigger
    matching
  • If not ? We showed that M is maximum by
    presenting a vertex cover of size M as a
    witness.

4
Weighted bipartite matching
  • Unweighted case maximize the number of edges in
    matching
  • Weighted case maximize the sum of the weights in
    the matching
  • Solvable in polynomial time using similar
    concepts.

5
Stable matchings
  • Instead of weights we are given preference
    rankings
  • In other words, each node ranks available nodes
  • Suppose we have matched pairs (x, b) and (y, a)
    but
  • x prefers a to b and
  • a prefers x to y
  • We say the unmatched pair (x,a) is unstable.
  • A stable matching is a matching with no unstable
    unmatched pair.
  • Solvable in polynomial time.

6
Matchings in general graphs
  • Both weighted and unweighted cases can be solved
    in polynomial time.
  • Initial algorithms by Edmonds.
  • The running time is roughly cubic in n.

7
Network Flow Problems
  • A network is a directed graph with
  • A capacity c(e) for each edge e
  • A source vertex s
  • And a terminal (sink) vertex t

8
Flow
  • A flow f assigns a value f(e) to each edge e
  • f(v) total flow leaving v
  • f-(v) total flow into v
  • A flow is feasible if it satisfies
  • Capacity constraints 0 ?f(e)?c(e) for each e
  • Conservation constraints f(v) f-(v) for each
    node other than s and t

9
Maximum Flow Problem
  • The value of flow
  • val(f) f-(t) - f(t)the amount of net flow
    into the sink
  • The maximum flow problem is to find a feasible
    flow of maximum value

10
Example
(1) 1
(1) 2
(0) 2
(1) 1
s
t
(0) 2
(1) 2
(1) 1
11
Augmenting Paths
  • Given a feasible flow f, for a network N, a path
    P is f-augmenting if for each edge e ? P
  • If P follows e in the forward direction, then
    f(e) lt c(e).
  • If P follows e in the backward direction, then
    f(e) gt 0

12
Augmenting Paths cont
  • Given a feasible flow f, for a network N, a path
    P is f-augmenting if for each edge e ? P
  • If P follows e in the forward direction, then
    f(e) lt c(e). In this case, let ??(e) c(e)
    f(e)
  • If P follows e in the backward direction, then
    f(e) gt 0. In this case, let ??(e) f(e).
  • The tolerance of P min ??(e) e ?P

13
Augmenting Path Example
14
Lemma
  • If P is an f-augmenting path with tolerance z,
    then changing flow by z on edges followed
    forward by P and by z on edges followed backward
    by P produces a feasible flow f with
    valueval(f) val(f) z

15
Proof
  • The definition of tolerance ensures that the
    capacity is never violated
  • For conservation, there are four possibilities
  • the netflow into the sink increases by z

P

-
-

-
-
16
Maximum flow algorithm
  • Similar to the maximum matching algorithm
  • Search for an augmenting flow.
  • If found, we create a bigger flow and repeat.
  • If not we need a witness to show that our flow
    is maximum.

17
Cuts
  • In a network, a source/sink cut S,T consists of
    edges from a source set S to sink set T where
  • S and T is a partitioning of the nodes
  • s ? S
  • t ? T
  • The capacity of the cut cap(S,T) is the total
    capacities on the edges of S, T

18
Intuitively
  • Given an S, T cut, every s-t path must use at
    least one edge of the cut
  • So the capacity of any flow is bounded by the
    capacity of the cut.
  • Perhaps we can use cuts as witnesses
  • Lets make this precise

19
Net flow
  • Let U be a set of vertices. Let
  • f(U) total flow on edges leaving U
  • f-(U) total flow on edges entering U
  • Define net flow out of U as
  • f(U)- f-(U)

20
Lemma
  • The net-flow out of U

Proof for each arc (x,y), lets look at the
contribution of (x,y) to lhs and rhs
21
Moreover
  • If f is a feasible flow and S, T is a
    source/sink cut, then the net flow out of S and
    the net flow into T are both equal to val(f).
  • Net flow from S equals f(s)- f-(s)

22
Corollary
  • If f is a feasible flow and S, T is a
    source/sink cut, then val(f) ? cap(S,T)
  • val(f) f(S)- f-(S) ? f(S)
  • The capacity constraints require
  • f(S) ? cap(S,T)

23
Duality
  • Therefore, for a given flow f, if we can find an
    S,T cut where the net flow out of S is equal to
    cap(f)
  • f must be a max-flow

24
Max Flow Algorithm
  • Input a feasible flow f
  • R s / reached set /
  • S ? / searched set /

25
Max Flow Algorithm Main Loop
  • Pick v ? R S
  • For each exiting edge (v,w) with f((v,w)) lt
    c((v,w)) and w?R,
  • Add w to R
  • For each entering edge (u,v) with f((u,v)) gt 0
    and u?R,
  • add u to R
  • After exploring all edges at v,
  • Add v to S
  • If the sink becomes in R
  • Augmenting path found
  • Else If R S
  • Report S, V-S as a min-cut
  • Otherwise, repeat

26
Augmenting Path Example
27
Min-cut/Max-flow Theorem
  • In every network, the maximum value of a feasible
    flow equals the minimum capacity of a source-sink
    cut

28
Proof
  • If we reach the sink
  • We find an augmenting flow, increase the value
  • Eventually will reach the capacity of some cut
  • The labeling algorithm terminates with S R
  • Claim S,T is a source-sink cut with capacity
    val(f) where T V-S
  • It is a cut because s?S and t ? S
  • Note that when we apply the max-flow algorithm,
    no node in T is added to R
  • This means that no edge from S to T has excess
    capacity andno edge from T to S has non-zero
    flow

29
Recall our lemma
  • val(f) f(S)- f-(S) ? f(S)
  • Remember
  • In other words f-(S) 0
  • f(S) cap(S,T)

no edge from S to T has excess capacity andno
edge from T to S has non-zero flow
30
A few remarks
  • If the capacities are integers, the flow will
    also be integral
  • We can compute maximum matchings in bipartite
    graphs using max-flows.
Write a Comment
User Comments (0)
About PowerShow.com