Network Flows Math 482, Lecture 23 Misha Lavrov March 30, 2020 - - PowerPoint PPT Presentation

network flows
SMART_READER_LITE
LIVE PREVIEW

Network Flows Math 482, Lecture 23 Misha Lavrov March 30, 2020 - - PowerPoint PPT Presentation

Network Flows Upper bounds on flow Network Flows Math 482, Lecture 23 Misha Lavrov March 30, 2020 Network Flows Upper bounds on flow Definition of a network 1 4 2 1 s t 3 2 1 2 3 2 3 2 A set N of nodes . Here, N = { s , 1 , 2 ,


slide-1
SLIDE 1

Network Flows Upper bounds on flow

Network Flows

Math 482, Lecture 23 Misha Lavrov March 30, 2020

slide-2
SLIDE 2

Network Flows Upper bounds on flow

Definition of a network

s 1 2 3 4 t

1 2 3 2 2 1 3 2

A set N of nodes. Here, N = {s, 1, 2, 3, 4, t}. Node s is the source and node t is the sink.

slide-3
SLIDE 3

Network Flows Upper bounds on flow

Definition of a network

s 1 2 3 4 t

1 2 3 2 2 1 3 2

A set N of nodes. Here, N = {s, 1, 2, 3, 4, t}. Node s is the source and node t is the sink. A set A of arcs: pairs of nodes. In this example,

A = {(s, 1), (s, 2), (1, 2), (2, 3), (3, 1), (3, 4), (3, t), (4, 1)}.

slide-4
SLIDE 4

Network Flows Upper bounds on flow

Definition of a network

s 1 2 3 4 t

1 2 3 2 2 1 3 2

A set N of nodes. Here, N = {s, 1, 2, 3, 4, t}. Node s is the source and node t is the sink. A set A of arcs: pairs of nodes. In this example,

A = {(s, 1), (s, 2), (1, 2), (2, 3), (3, 1), (3, 4), (3, t), (4, 1)}.

A nonnegative real capacity cij on each arc (i, j). Here, cs1 = 1, c12 = 3, and so on.

slide-5
SLIDE 5

Network Flows Upper bounds on flow

Definition of a network

s 1 2 3 4 t

1 2 3 2 2 1 3 2

A set N of nodes. Here, N = {s, 1, 2, 3, 4, t}. Node s is the source and node t is the sink. A set A of arcs: pairs of nodes. In this example,

A = {(s, 1), (s, 2), (1, 2), (2, 3), (3, 1), (3, 4), (3, t), (4, 1)}.

A nonnegative real capacity cij on each arc (i, j). Here, cs1 = 1, c12 = 3, and so on.

slide-6
SLIDE 6

Network Flows Upper bounds on flow

Definition of a network flow, I

A flow x assigns a number xij to each arc (i, j) ∈ A. s 1 2 3 4 t

1/1 1/2 1/3 2/2 0/2 0/1 2/3 0/2

We write “p/q” on an arc (i, j) with flow xij = p and capacity cij = q.

slide-7
SLIDE 7

Network Flows Upper bounds on flow

Definition of a network flow, I

A flow x assigns a number xij to each arc (i, j) ∈ A. s 1 2 3 4 t

1/1 1/2 1/3 2/2 0/2 0/1 2/3 0/2

We write “p/q” on an arc (i, j) with flow xij = p and capacity cij = q. A flow represents stuff moving from s to t; xij is the amount

  • f stuff moving along arc (i, j).
slide-8
SLIDE 8

Network Flows Upper bounds on flow

Definition of a network flow, I

A flow x assigns a number xij to each arc (i, j) ∈ A. s 1 2 3 4 t

1/1 1/2 1/3 2/2 0/2 0/1 2/3 0/2

We write “p/q” on an arc (i, j) with flow xij = p and capacity cij = q. A flow represents stuff moving from s to t; xij is the amount

  • f stuff moving along arc (i, j).

For this to make sense, we want to add some constraints on x for it to be a feasible flow.

slide-9
SLIDE 9

Network Flows Upper bounds on flow

Definition of a network flow, II

Constraints on a feasible flow: Capacity constraints: for every arc (i, j) ∈ A, xij ≤ cij.

slide-10
SLIDE 10

Network Flows Upper bounds on flow

Definition of a network flow, II

Constraints on a feasible flow: Capacity constraints: for every arc (i, j) ∈ A, xij ≤ cij. Nonnegativity constraints: x ≥ 0.

slide-11
SLIDE 11

Network Flows Upper bounds on flow

Definition of a network flow, II

Constraints on a feasible flow: Capacity constraints: for every arc (i, j) ∈ A, xij ≤ cij. Nonnegativity constraints: x ≥ 0. Flow conservation: at every node k ∈ N except for s and t, the total flow going in is equal to the total flow going out. s 1 2 3

1/2 1/3 2/2

At node k = 2, we must have xs2 + x12 = x23. Here, 1 + 1 = 2.

slide-12
SLIDE 12

Network Flows Upper bounds on flow

More on flow conservation

The excess at a node k is the difference between the total flow into k and the total flow out of k: ∆k(x) :=

  • i:(i,k)∈A

xik −

  • j:(k,j)∈A

xkj.

slide-13
SLIDE 13

Network Flows Upper bounds on flow

More on flow conservation

The excess at a node k is the difference between the total flow into k and the total flow out of k: ∆k(x) :=

  • i:(i,k)∈A

xik −

  • j:(k,j)∈A

xkj. Flow conservation: at every node k = s, t, ∆k(x) = 0.

slide-14
SLIDE 14

Network Flows Upper bounds on flow

More on flow conservation

The excess at a node k is the difference between the total flow into k and the total flow out of k: ∆k(x) :=

  • i:(i,k)∈A

xik −

  • j:(k,j)∈A

xkj. Flow conservation: at every node k = s, t, ∆k(x) = 0. At the sink t, the excess ∆t(x) represents the amount of stuff we’ve successfully brought to t from s. This is called the value of x.

slide-15
SLIDE 15

Network Flows Upper bounds on flow

More on flow conservation

The excess at a node k is the difference between the total flow into k and the total flow out of k: ∆k(x) :=

  • i:(i,k)∈A

xik −

  • j:(k,j)∈A

xkj. Flow conservation: at every node k = s, t, ∆k(x) = 0. At the sink t, the excess ∆t(x) represents the amount of stuff we’ve successfully brought to t from s. This is called the value of x. We can prove that ∆s(x) = −∆t(x): the amount of gain at t is equal to the amount of loss at s. (This should follow from flow conservation.)

slide-16
SLIDE 16

Network Flows Upper bounds on flow

The maximum flow LP

The maximum flow problem to find the feasible flow in a network with the maximum value can be written as a linear program: maximize

x∈R|A|

  • i:(i,t)∈A

xit −

  • j:(t,j)∈A

xtj subject to

  • i:(i,k)∈A

xik −

  • j:(k,j)∈A

xkj = 0 (k ∈ N, k = s, t) xij ≤ cij (i, j) ∈ A x ≥ 0

slide-17
SLIDE 17

Network Flows Upper bounds on flow

The maximum flow LP

The maximum flow problem to find the feasible flow in a network with the maximum value can be written as a linear program: maximize

x∈R|A|

  • i:(i,t)∈A

xit −

  • j:(t,j)∈A

xtj subject to

  • i:(i,k)∈A

xik −

  • j:(k,j)∈A

xkj = 0 (k ∈ N, k = s, t) xij ≤ cij (i, j) ∈ A x ≥ 0 We can assume there are no arcs into s or out of t. In that case, value of x =

  • i:(i,t)∈A

xit =

  • j:(s,j)∈A

xsj.

slide-18
SLIDE 18

Network Flows Upper bounds on flow

How can we tell if a flow is optimal?

The flow in the example below has a value of 7. Can we do better? s a b t

3/3 4/4 1/5 2/2 5/7

slide-19
SLIDE 19

Network Flows Upper bounds on flow

How can we tell if a flow is optimal?

The flow in the example below has a value of 7. Can we do better? s a b t

3/3 4/4 1/5 2/2 5/7

No; the arcs out of s are all at their maximum capacity. We can’t send more than 7 flow out of s.

slide-20
SLIDE 20

Network Flows Upper bounds on flow

How can we tell if a flow is optimal?

The flow in the example below has a value of 7. Can we do better? s a b t

3/3 4/7 0/3 3/5 4/4

slide-21
SLIDE 21

Network Flows Upper bounds on flow

How can we tell if a flow is optimal?

The flow in the example below has a value of 7. Can we do better? s a b t

3/3 4/7 0/3 3/5 4/4

No: the arcs from {s, b} to {a, t} are all at their maximum capacity, and the arcs from {a, t} to {s, b} are all at capacity 0. We can’t send more than 7 flow from {s, b} to {a, t}.

slide-22
SLIDE 22

Network Flows Upper bounds on flow

Cuts

Definition An cut in a network is a partition of the node set N into two sets S and T, such that s ∈ S and t ∈ T.

slide-23
SLIDE 23

Network Flows Upper bounds on flow

Cuts

Definition An cut in a network is a partition of the node set N into two sets S and T, such that s ∈ S and t ∈ T. The capacity of a cut (S, T) is the sum

  • i∈S
  • j∈T

cij. (If (i, j) / ∈ A, we say that cij = 0.)

slide-24
SLIDE 24

Network Flows Upper bounds on flow

Cuts

Definition An cut in a network is a partition of the node set N into two sets S and T, such that s ∈ S and t ∈ T. The capacity of a cut (S, T) is the sum

  • i∈S
  • j∈T

cij. (If (i, j) / ∈ A, we say that cij = 0.) s a b t

3 7 3 5 4

Here, S = {s, b}, T = {a, t}, and the capacity is csa + cbt = 7.

slide-25
SLIDE 25

Network Flows Upper bounds on flow

Cuts are upper bounds on flows

Theorem If a feasible flow x has value v(x), and a cut (S, T) has capacity c(S, T), then v(x) ≤ c(S, T).

slide-26
SLIDE 26

Network Flows Upper bounds on flow

Cuts are upper bounds on flows

Theorem If a feasible flow x has value v(x), and a cut (S, T) has capacity c(S, T), then v(x) ≤ c(S, T). Proof idea: consider the sum

  • k∈S

 

  • j:(k,j)∈A

xkj −

  • i:(i,k)∈A

xik   By computing this sum in two ways, we show that it is equal to v(x), and also that it is at most c(S, T).

slide-27
SLIDE 27

Network Flows Upper bounds on flow

Step 1

In the sum

  • k∈S

 

  • j:(k,j)∈A

xkj −

  • i:(i,k)∈A

xik   the difference (in orange) is the net flow out of k. When k = s, it is 0. When k = s, it is the value of the flow. Therefore

  • k∈S

 

  • j:(k,j)∈A

xkj −

  • i:(i,k)∈A

xik   =

  • j:(s,j)∈A

xsj −

  • i:(i,s)∈A

xis = v(x).

slide-28
SLIDE 28

Network Flows Upper bounds on flow

Step 2

How many times, and with what sign, does xij appear in the sum

  • k∈S

 

  • j:(k,j)∈A

xkj −

  • i:(i,k)∈A

xik  ?

slide-29
SLIDE 29

Network Flows Upper bounds on flow

Step 2

How many times, and with what sign, does xij appear in the sum

  • k∈S

 

  • j:(k,j)∈A

xkj −

  • i:(i,k)∈A

xik  ? Once, with + sign, if i ∈ S. Once, with − sign, if j ∈ S.

slide-30
SLIDE 30

Network Flows Upper bounds on flow

Step 2

How many times, and with what sign, does xij appear in the sum

  • k∈S

 

  • j:(k,j)∈A

xkj −

  • i:(i,k)∈A

xik  ? Once, with + sign, if i ∈ S. Once, with − sign, if j ∈ S. Therefore

  • k∈S

 

  • j:(k,j)∈A

xkj −

  • i:(i,k)∈A

xik   =

  • i∈S
  • j∈T

xij −

  • i∈T
  • j∈S

xij.

slide-31
SLIDE 31

Network Flows Upper bounds on flow

Step 2, continued

  • k∈S

 

  • j:(k,j)∈A

xkj −

  • i:(i,k)∈A

xik   =

  • i∈S
  • j∈T

xij −

  • i∈T
  • j∈S

xij.

slide-32
SLIDE 32

Network Flows Upper bounds on flow

Step 2, continued

  • k∈S

 

  • j:(k,j)∈A

xkj −

  • i:(i,k)∈A

xik   =

  • i∈S
  • j∈T

xij −

  • i∈T
  • j∈S

xij. For the sum in red, use xij ≤ cij:

  • i∈S
  • j∈T

xij ≤

  • i∈S
  • j∈T

cij = c(S, T).

slide-33
SLIDE 33

Network Flows Upper bounds on flow

Step 2, continued

  • k∈S

 

  • j:(k,j)∈A

xkj −

  • i:(i,k)∈A

xik   =

  • i∈S
  • j∈T

xij −

  • i∈T
  • j∈S

xij. For the sum in red, use xij ≤ cij:

  • i∈S
  • j∈T

xij ≤

  • i∈S
  • j∈T

cij = c(S, T). The sum in blue is ≥ 0, so for an upper bound, we can ignore it.

slide-34
SLIDE 34

Network Flows Upper bounds on flow

Step 2, continued

  • k∈S

 

  • j:(k,j)∈A

xkj −

  • i:(i,k)∈A

xik   =

  • i∈S
  • j∈T

xij −

  • i∈T
  • j∈S

xij. For the sum in red, use xij ≤ cij:

  • i∈S
  • j∈T

xij ≤

  • i∈S
  • j∈T

cij = c(S, T). The sum in blue is ≥ 0, so for an upper bound, we can ignore it. We conclude that v(x) =

  • k∈S

 

  • j:(k,j)∈A

xkj −

  • i:(i,k)∈A

xik   ≤ c(S, T).