graph7 - basics.sjtu.edu.cnbasics.sjtu.edu.cn/~chen/teaching/gr07/graph7.pdf · graph theory (vii)...

57
Page 1 G RAPH T HEORY Yijia Chen Shanghai Jiaotong University 2007/2008 Shanghai

Upload: hoangtuyen

Post on 20-Mar-2018

223 views

Category:

Documents


4 download

TRANSCRIPT

Page 1

GRAPH THEORY

Yijia ChenShanghai Jiaotong University

2007/2008

Shanghai

GRAPH THEORY (VII) Page 2

Chapter 6. Flows

Shanghai

GRAPH THEORY (VII) Page 3

6.1 Circulations

Shanghai

GRAPH THEORY (VII) Page 3

6.1 Circulations

A multigraph is a pair (V, E) of disjoint sets (of vertices and edges) together with a map

E → V ∪ [V ]2 assigning to every edge either one or two vertices, its ends.

Shanghai

GRAPH THEORY (VII) Page 3

6.1 Circulations

A multigraph is a pair (V, E) of disjoint sets (of vertices and edges) together with a map

E → V ∪ [V ]2 assigning to every edge either one or two vertices, its ends.

Multigraphs can have loops and multiple edges: we may think of a multigraph as a directed

graph whose edge directions have been ‘forgotten’.

Shanghai

GRAPH THEORY (VII) Page 3

6.1 Circulations

A multigraph is a pair (V, E) of disjoint sets (of vertices and edges) together with a map

E → V ∪ [V ]2 assigning to every edge either one or two vertices, its ends.

Multigraphs can have loops and multiple edges: we may think of a multigraph as a directed

graph whose edge directions have been ‘forgotten’.

To express that x and y are the ends of an edge e we still write e = xy, though this no longer

determines e uniquely.

Shanghai

GRAPH THEORY (VII) Page 3

6.1 Circulations

A multigraph is a pair (V, E) of disjoint sets (of vertices and edges) together with a map

E → V ∪ [V ]2 assigning to every edge either one or two vertices, its ends.

Multigraphs can have loops and multiple edges: we may think of a multigraph as a directed

graph whose edge directions have been ‘forgotten’.

To express that x and y are the ends of an edge e we still write e = xy, though this no longer

determines e uniquely.

Thus we define directed edges as triples:

−→E :=

{(e, x, y) | e ∈ E; x, y ∈ V ; e = xy

}.

Shanghai

GRAPH THEORY (VII) Page 3

6.1 Circulations

A multigraph is a pair (V, E) of disjoint sets (of vertices and edges) together with a map

E → V ∪ [V ]2 assigning to every edge either one or two vertices, its ends.

Multigraphs can have loops and multiple edges: we may think of a multigraph as a directed

graph whose edge directions have been ‘forgotten’.

To express that x and y are the ends of an edge e we still write e = xy, though this no longer

determines e uniquely.

Thus we define directed edges as triples:

−→E :=

{(e, x, y) | e ∈ E; x, y ∈ V ; e = xy

}.

Thus, an edge e = xy with x �= y has the two directions (e, x, y) and (e, y, x); a loop

e = xx has only one direction, the triple (e, x, x).

Shanghai

GRAPH THEORY (VII) Page 4

For given −→e = (e, x, y) ∈ −→E , we set←−e := (e, y, x), and for an arbitrary set−→F ⊆ −→E of

edge directions we put ←−F :=

{←−e | −→e ∈ −→F }.

Shanghai

GRAPH THEORY (VII) Page 4

For given −→e = (e, x, y) ∈ −→E , we set←−e := (e, y, x), and for an arbitrary set−→F ⊆ −→E of

edge directions we put ←−F :=

{←−e | −→e ∈ −→F }.

Note that−→E itself is symmetrical:

←−E =

−→E .

Shanghai

GRAPH THEORY (VII) Page 4

For given −→e = (e, x, y) ∈ −→E , we set←−e := (e, y, x), and for an arbitrary set−→F ⊆ −→E of

edge directions we put ←−F :=

{←−e | −→e ∈ −→F }.

Note that−→E itself is symmetrical:

←−E =

−→E .

For X, Y ⊆ V and−→F ⊆ −→E , define

−→F (X, Y ) :=

{(e, x, y) ∈ −→F | x ∈ X; y ∈ Y ; x �= y

},

Shanghai

GRAPH THEORY (VII) Page 4

For given −→e = (e, x, y) ∈ −→E , we set←−e := (e, y, x), and for an arbitrary set−→F ⊆ −→E of

edge directions we put ←−F :=

{←−e | −→e ∈ −→F }.

Note that−→E itself is symmetrical:

←−E =

−→E .

For X, Y ⊆ V and−→F ⊆ −→E , define

−→F (X, Y ) :=

{(e, x, y) ∈ −→F | x ∈ X; y ∈ Y ; x �= y

},

Abbreviate−→F ({x}, Y ) to

−→F (x, Y ) etc., and write

−→F (x) :=

−→F (x, V ) =

−→F ({x}, {x}).

Here, X denotes the complement V/X of a vertex set X ⊆ V .

Shanghai

GRAPH THEORY (VII) Page 4

For given −→e = (e, x, y) ∈ −→E , we set←−e := (e, y, x), and for an arbitrary set−→F ⊆ −→E of

edge directions we put ←−F :=

{←−e | −→e ∈ −→F }.

Note that−→E itself is symmetrical:

←−E =

−→E .

For X, Y ⊆ V and−→F ⊆ −→E , define

−→F (X, Y ) :=

{(e, x, y) ∈ −→F | x ∈ X; y ∈ Y ; x �= y

},

Abbreviate−→F ({x}, Y ) to

−→F (x, Y ) etc., and write

−→F (x) :=

−→F (x, V ) =

−→F ({x}, {x}).

Here, X denotes the complement V/X of a vertex set X ⊆ V .

Note that any loops at vertices x ∈ X ∩ Y are disregarded in the definitions of−→F (X, Y ) and−→

F (x).

Shanghai

GRAPH THEORY (VII) Page 5

Let H be an abelian semigroup, written additively with zero 0.

Shanghai

GRAPH THEORY (VII) Page 5

Let H be an abelian semigroup, written additively with zero 0.

Given vertex sets X, Y ⊆ V and a function f :−→E → H , let

f(X, Y ) :=∑

−→e ∈−→E (X,Y )

f(−→e ).

Shanghai

GRAPH THEORY (VII) Page 5

Let H be an abelian semigroup, written additively with zero 0.

Given vertex sets X, Y ⊆ V and a function f :−→E → H , let

f(X, Y ) :=∑

−→e ∈−→E (X,Y )

f(−→e ).

Instead of f({x}, Y ) we again write f(x, Y ), etc.

Shanghai

GRAPH THEORY (VII) Page 5

Let H be an abelian semigroup, written additively with zero 0.

Given vertex sets X, Y ⊆ V and a function f :−→E → H , let

f(X, Y ) :=∑

−→e ∈−→E (X,Y )

f(−→e ).

Instead of f({x}, Y ) we again write f(x, Y ), etc.

From now on, we assume that H is a group. We call f a circulation on G (with values in H),

or an H-circulation, if f satisfies the following two conditions:

Shanghai

GRAPH THEORY (VII) Page 5

Let H be an abelian semigroup, written additively with zero 0.

Given vertex sets X, Y ⊆ V and a function f :−→E → H , let

f(X, Y ) :=∑

−→e ∈−→E (X,Y )

f(−→e ).

Instead of f({x}, Y ) we again write f(x, Y ), etc.

From now on, we assume that H is a group. We call f a circulation on G (with values in H),

or an H-circulation, if f satisfies the following two conditions:

(F1) f(e, x, y) = −f(e, y, x) for all (e, x, y) ∈ −→E with x �= y;

Shanghai

GRAPH THEORY (VII) Page 5

Let H be an abelian semigroup, written additively with zero 0.

Given vertex sets X, Y ⊆ V and a function f :−→E → H , let

f(X, Y ) :=∑

−→e ∈−→E (X,Y )

f(−→e ).

Instead of f({x}, Y ) we again write f(x, Y ), etc.

From now on, we assume that H is a group. We call f a circulation on G (with values in H),

or an H-circulation, if f satisfies the following two conditions:

(F1) f(e, x, y) = −f(e, y, x) for all (e, x, y) ∈ −→E with x �= y;

(F2) f(v, V ) = 0 for all v ∈ V .

Shanghai

GRAPH THEORY (VII) Page 6

If f satisfies (F1), then

f(X, X) = 0

for all X ⊆ V .

Shanghai

GRAPH THEORY (VII) Page 6

If f satisfies (F1), then

f(X, X) = 0

for all X ⊆ V .

If f satisfies (F2), then

f(X, V ) =∑x∈X

f(x, V ) = 0.

Shanghai

GRAPH THEORY (VII) Page 6

If f satisfies (F1), then

f(X, X) = 0

for all X ⊆ V .

If f satisfies (F2), then

f(X, V ) =∑x∈X

f(x, V ) = 0.

Together, these two basic observations imply that, in a circulation, the net flow across any

cut is zero:

Proposition. If f is a circulation, then f(X, X) = 0 for every set X ⊆ V .

Shanghai

GRAPH THEORY (VII) Page 6

If f satisfies (F1), then

f(X, X) = 0

for all X ⊆ V .

If f satisfies (F2), then

f(X, V ) =∑x∈X

f(x, V ) = 0.

Together, these two basic observations imply that, in a circulation, the net flow across any

cut is zero:

Proposition. If f is a circulation, then f(X, X) = 0 for every set X ⊆ V .

Corollary. If f is a circulation and e = xy is a bridge in G, then f(e, x, y) = 0.

Shanghai

GRAPH THEORY (VII) Page 7

6.2 Flows in networks

Shanghai

GRAPH THEORY (VII) Page 7

6.2 Flows in networks

Let G = (V, E) be a multigraph, s, t ∈ V two fixed vertices, and c :−→E → N a map; we call

c a capacity function on G, and the tuple N := (G, s, t, c) a network.

Shanghai

GRAPH THEORY (VII) Page 7

6.2 Flows in networks

Let G = (V, E) be a multigraph, s, t ∈ V two fixed vertices, and c :−→E → N a map; we call

c a capacity function on G, and the tuple N := (G, s, t, c) a network.

Note that c is defined independently for the two directions of an edge.

Shanghai

GRAPH THEORY (VII) Page 7

6.2 Flows in networks

Let G = (V, E) be a multigraph, s, t ∈ V two fixed vertices, and c :−→E → N a map; we call

c a capacity function on G, and the tuple N := (G, s, t, c) a network.

Note that c is defined independently for the two directions of an edge.

A function f :−→E → R is a flow in N if it satisfies the following three conditions:

Shanghai

GRAPH THEORY (VII) Page 7

6.2 Flows in networks

Let G = (V, E) be a multigraph, s, t ∈ V two fixed vertices, and c :−→E → N a map; we call

c a capacity function on G, and the tuple N := (G, s, t, c) a network.

Note that c is defined independently for the two directions of an edge.

A function f :−→E → R is a flow in N if it satisfies the following three conditions:

(F1) f(e, x, y) = −f(e, y, x) for all (e, x, y) ∈ −→E with x �= y;

Shanghai

GRAPH THEORY (VII) Page 7

6.2 Flows in networks

Let G = (V, E) be a multigraph, s, t ∈ V two fixed vertices, and c :−→E → N a map; we call

c a capacity function on G, and the tuple N := (G, s, t, c) a network.

Note that c is defined independently for the two directions of an edge.

A function f :−→E → R is a flow in N if it satisfies the following three conditions:

(F1) f(e, x, y) = −f(e, y, x) for all (e, x, y) ∈ −→E with x �= y;

(F2′) f(v, V ) = 0 for all v ∈ V \ {s, t};

Shanghai

GRAPH THEORY (VII) Page 7

6.2 Flows in networks

Let G = (V, E) be a multigraph, s, t ∈ V two fixed vertices, and c :−→E → N a map; we call

c a capacity function on G, and the tuple N := (G, s, t, c) a network.

Note that c is defined independently for the two directions of an edge.

A function f :−→E → R is a flow in N if it satisfies the following three conditions:

(F1) f(e, x, y) = −f(e, y, x) for all (e, x, y) ∈ −→E with x �= y;

(F2′) f(v, V ) = 0 for all v ∈ V \ {s, t};(F3) f(−→e ) ≤ c(−→e ) for all −→e ∈ −→E .

Shanghai

GRAPH THEORY (VII) Page 7

6.2 Flows in networks

Let G = (V, E) be a multigraph, s, t ∈ V two fixed vertices, and c :−→E → N a map; we call

c a capacity function on G, and the tuple N := (G, s, t, c) a network.

Note that c is defined independently for the two directions of an edge.

A function f :−→E → R is a flow in N if it satisfies the following three conditions:

(F1) f(e, x, y) = −f(e, y, x) for all (e, x, y) ∈ −→E with x �= y;

(F2′) f(v, V ) = 0 for all v ∈ V \ {s, t};(F3) f(−→e ) ≤ c(−→e ) for all −→e ∈ −→E .

We call f integral if all its values are integers.

Shanghai

GRAPH THEORY (VII) Page 8

Let f be a flow in N . If S ⊆ V is such that s ∈ S and t ∈ S, we call the pair (S, S) a cut in

N , and c(S, S) the capacity of this cut.

Shanghai

GRAPH THEORY (VII) Page 8

Let f be a flow in N . If S ⊆ V is such that s ∈ S and t ∈ S, we call the pair (S, S) a cut in

N , and c(S, S) the capacity of this cut.

Proposition. Every cut (S, S) in N satisfies

f(S, S) = f(s, V ).

Shanghai

GRAPH THEORY (VII) Page 8

Let f be a flow in N . If S ⊆ V is such that s ∈ S and t ∈ S, we call the pair (S, S) a cut in

N , and c(S, S) the capacity of this cut.

Proposition. Every cut (S, S) in N satisfies

f(S, S) = f(s, V ).

The common value of f(S, S) will be called the total value of f and denoted by |f |.

Shanghai

GRAPH THEORY (VII) Page 8

Let f be a flow in N . If S ⊆ V is such that s ∈ S and t ∈ S, we call the pair (S, S) a cut in

N , and c(S, S) the capacity of this cut.

Proposition. Every cut (S, S) in N satisfies

f(S, S) = f(s, V ).

The common value of f(S, S) will be called the total value of f and denoted by |f |.

By (F3), we have

|f | = f(S, S)

for every cut (S, S) in N .

Shanghai

GRAPH THEORY (VII) Page 9

Theorem.[Ford and Fulkerson 1956] In every network, the maximum total value of a flow

equals the minimum capacity of a cut.

Shanghai

GRAPH THEORY (VII) Page 9

Theorem.[Ford and Fulkerson 1956] In every network, the maximum total value of a flow

equals the minimum capacity of a cut.

Proof.

Shanghai

GRAPH THEORY (VII) Page 9

Theorem.[Ford and Fulkerson 1956] In every network, the maximum total value of a flow

equals the minimum capacity of a cut.

Proof.

Let N = (G, s, t, c) be a network, and G = (V, E). We shall define a sequence f0, f1, f2,

. . . of integral flows in N of strictly increasing total value, i.e. with

|f0| < |f1| < |f2| < · · ·

Shanghai

GRAPH THEORY (VII) Page 9

Theorem.[Ford and Fulkerson 1956] In every network, the maximum total value of a flow

equals the minimum capacity of a cut.

Proof.

Let N = (G, s, t, c) be a network, and G = (V, E). We shall define a sequence f0, f1, f2,

. . . of integral flows in N of strictly increasing total value, i.e. with

|f0| < |f1| < |f2| < · · ·

Clearly, the total value of an integral flow is again an integer, so in fact

|fn+1| ≥ |fn|+ 1

for all n.

Shanghai

GRAPH THEORY (VII) Page 10

Proof. (Cont’d)

Shanghai

GRAPH THEORY (VII) Page 10

Proof. (Cont’d)

Since all these numbers are bounded above by the capacity of any cut in N , our sequence

will terminate with some flow fn.

Shanghai

GRAPH THEORY (VII) Page 10

Proof. (Cont’d)

Since all these numbers are bounded above by the capacity of any cut in N , our sequence

will terminate with some flow fn.

Corresponding to this flow, we shall find a cut of capacity cn = |fn|.

Shanghai

GRAPH THEORY (VII) Page 10

Proof. (Cont’d)

Since all these numbers are bounded above by the capacity of any cut in N , our sequence

will terminate with some flow fn.

Corresponding to this flow, we shall find a cut of capacity cn = |fn|.Since no flow can have a total value greater than cn, and no cut can have a capacity less than

|fn|, this number is simultaneously the maximum and the minimum referred to in the

theorem.

Shanghai

GRAPH THEORY (VII) Page 10

Proof. (Cont’d)

Since all these numbers are bounded above by the capacity of any cut in N , our sequence

will terminate with some flow fn.

Corresponding to this flow, we shall find a cut of capacity cn = |fn|.Since no flow can have a total value greater than cn, and no cut can have a capacity less than

|fn|, this number is simultaneously the maximum and the minimum referred to in the

theorem.

For f0, we set f0(−→e ) := 0 for all −→e ∈ −→E .

Shanghai

GRAPH THEORY (VII) Page 10

Proof. (Cont’d)

Since all these numbers are bounded above by the capacity of any cut in N , our sequence

will terminate with some flow fn.

Corresponding to this flow, we shall find a cut of capacity cn = |fn|.Since no flow can have a total value greater than cn, and no cut can have a capacity less than

|fn|, this number is simultaneously the maximum and the minimum referred to in the

theorem.

For f0, we set f0(−→e ) := 0 for all −→e ∈ −→E .

Having defined an integral flow fn in N for some n ∈ N, we denote by Sn the set of all

vertices v such that G contains an s-v walk x0e0 . . . e�−1x� with

fn(−→ei ) < c(−→ei )

for all i < �; here, −→ei := (ei, xi, xi+1) (and, of course, x0 = s and x� = v).

Shanghai

GRAPH THEORY (VII) Page 11

Proof. (Cont’d)

Shanghai

GRAPH THEORY (VII) Page 11

Proof. (Cont’d)

If t ∈ Sn, let W = x0e0 . . . e�−1x� be the corresponding s-t walk; without loss of generality

we may assume that W does not repeat any vertices.

Shanghai

GRAPH THEORY (VII) Page 11

Proof. (Cont’d)

If t ∈ Sn, let W = x0e0 . . . e�−1x� be the corresponding s-t walk; without loss of generality

we may assume that W does not repeat any vertices.

Let

ε := min{c(−→ei )− fn(−→ei ) | i < �

}.

Then ε > 0, and since fn (like c) is integral by assumption, ε is an integer.

Shanghai

GRAPH THEORY (VII) Page 11

Proof. (Cont’d)

If t ∈ Sn, let W = x0e0 . . . e�−1x� be the corresponding s-t walk; without loss of generality

we may assume that W does not repeat any vertices.

Let

ε := min{c(−→ei )− fn(−→ei ) | i < �

}.

Then ε > 0, and since fn (like c) is integral by assumption, ε is an integer.

Let

fn + 1(−→e ) :=

⎧⎪⎪⎨⎪⎪⎩

fn(−→e ) + ε for −→e = −→ei , i = 0, . . . , �− 1;

fn(−→e )− ε for −→e =←−ei , i = 0, . . . , �− 1;

fn(−→e ) for e /∈W.

Shanghai

GRAPH THEORY (VII) Page 11

Proof. (Cont’d)

If t ∈ Sn, let W = x0e0 . . . e�−1x� be the corresponding s-t walk; without loss of generality

we may assume that W does not repeat any vertices.

Let

ε := min{c(−→ei )− fn(−→ei ) | i < �

}.

Then ε > 0, and since fn (like c) is integral by assumption, ε is an integer.

Let

fn + 1(−→e ) :=

⎧⎪⎪⎨⎪⎪⎩

fn(−→e ) + ε for −→e = −→ei , i = 0, . . . , �− 1;

fn(−→e )− ε for −→e =←−ei , i = 0, . . . , �− 1;

fn(−→e ) for e /∈W.

Intuitively, fn+1 is obtained from fn by sending additional flow of value ε along W from s

to t

Shanghai

GRAPH THEORY (VII) Page 12

Proof. (Cont’d)

Shanghai

GRAPH THEORY (VII) Page 12

Proof. (Cont’d)

Clearly, fn+1 is again an integral flow in N .

Shanghai

GRAPH THEORY (VII) Page 12

Proof. (Cont’d)

Clearly, fn+1 is again an integral flow in N .

Since W contains the vertex s only once, −→e0 is the only triple (e, x, y) with x = s and y ∈ V

whose f -value was changed.

Shanghai

GRAPH THEORY (VII) Page 12

Proof. (Cont’d)

Clearly, fn+1 is again an integral flow in N .

Since W contains the vertex s only once, −→e0 is the only triple (e, x, y) with x = s and y ∈ V

whose f -value was changed. This value, and hence that of fn+1(s, V ) was raised.

Therefore |fn+1| > |fn| as desired.

Shanghai

GRAPH THEORY (VII) Page 12

Proof. (Cont’d)

Clearly, fn+1 is again an integral flow in N .

Since W contains the vertex s only once, −→e0 is the only triple (e, x, y) with x = s and y ∈ V

whose f -value was changed. This value, and hence that of fn+1(s, V ) was raised.

Therefore |fn+1| > |fn| as desired.

If t /∈ Sn, then (Sn, Sn) is a cut in N . By (F3) for fn, and the definition of Sn, we have

fn(−→e ) = c(−→e )

for all −→e ∈ −→E (Sn, Sn),

Shanghai

GRAPH THEORY (VII) Page 12

Proof. (Cont’d)

Clearly, fn+1 is again an integral flow in N .

Since W contains the vertex s only once, −→e0 is the only triple (e, x, y) with x = s and y ∈ V

whose f -value was changed. This value, and hence that of fn+1(s, V ) was raised.

Therefore |fn+1| > |fn| as desired.

If t /∈ Sn, then (Sn, Sn) is a cut in N . By (F3) for fn, and the definition of Sn, we have

fn(−→e ) = c(−→e )

for all −→e ∈ −→E (Sn, Sn), so

|fn| = fn(Sn, Sn) = c(Sn, Sn)

as desired. �

Shanghai

GRAPH THEORY (VII) Page 13

Corollary. In every network (with integral capacity function) there exists an integral flow

of maximum total value.

Shanghai