Network Flow: Basic Algorithms - Lecture Slides | CS 473, Study notes of Algorithms and Programming

Material Type: Notes; Class: Fundamental Algorithms; Subject: Computer Science; University: University of Illinois - Urbana-Champaign; Term: Spring 2008;

Typology: Study notes

Pre 2010

Uploaded on 03/16/2009

koofers-user-b13
koofers-user-b13 🇺🇸

9 documents

1 / 111

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS 473ug: Algorithms
Mahesh Viswanathan
3232 Siebel Center
University of Illinois, Urbana-Champaign
Spring 2008
Viswanathan CS473ug
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Network Flow: Basic Algorithms - Lecture Slides | CS 473 and more Study notes Algorithms and Programming in PDF only on Docsity!

CS 473ug: Algorithms

Mahesh Viswanathan [email protected] 3232 Siebel Center

University of Illinois, Urbana-Champaign

Spring 2008

Maximum Flow AlgorithmsCorrectness and Analysis Polynomial Time Algorithms

Part I

Network Flow: Basic Algorithms

Polynomial Time Algorithms Ford-Fulkerson Algorithm

Flow Networks

Definition Flow network is an abstraction of a transportation network. It is a directed graph G = (V , E ) with

s

1

2

3

4

5

6

t 15

5

10

30

8

4

9

4 15

6 10

10

15

15 10

Polynomial Time Algorithms Ford-Fulkerson Algorithm

Flow Networks

Definition Flow network is an abstraction of a transportation network. It is a directed graph G = (V , E ) with

s

1

2

3

4

5

6

t 15

5

10

30

8

4

9

4 15

6 10

10

15

(^15 10) Each edge e has a capacity c(e) ≥ 0

Polynomial Time Algorithms Ford-Fulkerson Algorithm

Flow Networks

Definition Flow network is an abstraction of a transportation network. It is a directed graph G = (V , E ) with

s

1

2

3

4

5

6

t 15

5

10

30

8

4

9

4 15

6 10

10

15

(^15 10) Each edge e has a capacity c(e) ≥ 0 Source s ∈ V with no incoming edges Sink t ∈ V with no outgoing edges

Assumptions: All capacities are integer, and every vertex has at least on edge incident to it.

Polynomial Time Algorithms Ford-Fulkerson Algorithm

Flows

Definition A flow in a network G = (V , E ), is a function f : E → R≥^0 such that

Polynomial Time Algorithms Ford-Fulkerson Algorithm

Flows

Definition A flow in a network G = (V , E ), is a function f : E → R≥^0 such that

Capacity Constraint: For each edge e, f (e) ≤ c(e) Conservation Constraint: For each vertex v 6 = s, t ∑

e into v

f (e) =

e out of v

f (e)

Polynomial Time Algorithms Ford-Fulkerson Algorithm

Flows

Definition A flow in a network G = (V , E ), is a function f : E → R≥^0 such that

s

1

2

3

4

5

6

t 14/

4/

10/

14/

8/

0/

9/

0/4 1/

4/6^ 10/

9/

0/

0/15 9/

Figure: Flow with value 28

Capacity Constraint: For each edge e, f (e) ≤ c(e) Conservation Constraint: For each vertex v 6 = s, t ∑

e into v

f (e) =

e out of v

f (e)

Polynomial Time Algorithms Ford-Fulkerson Algorithm

More Definitions and Notation

Notation The inflow into a vertex v is f in(v ) =

e into v f^ (e) and the outflow is f out(v ) =

e out of v f^ (e)

Polynomial Time Algorithms Ford-Fulkerson Algorithm

More Definitions and Notation

Notation The inflow into a vertex v is f in(v ) =

e into v f^ (e) and the outflow is f out(v ) =

e out of v f^ (e) For a set of vertices A, f in(A) =

e into A f^ (e). Outflow f out(A) is defined analogously

Polynomial Time Algorithms Ford-Fulkerson Algorithm

The Maximum-Flow Problem

Problem

Polynomial Time Algorithms Ford-Fulkerson Algorithm

The Maximum-Flow Problem

Problem Input A network G with capacity c and source s and sink t

Polynomial Time Algorithms Ford-Fulkerson Algorithm

Greedy Approach

s

v

u

t 10

20

20

10

30

(^1) Begin with f (e) = 0 for each edge (^2) Find a s-t path P with f (e) < c(e) for every edge e ∈ P (^3) Augment flow along this path (^4) Repeat augmentation for as long as possible.

Polynomial Time Algorithms Ford-Fulkerson Algorithm

Greedy Approach

s

v

u

t 10/

20

10/

10

30

(^1) Begin with f (e) = 0 for each edge (^2) Find a s-t path P with f (e) < c(e) for every edge e ∈ P (^3) Augment flow along this path (^4) Repeat augmentation for as long as possible.