basic graph theory - 國立臺灣大學discrete/course/part_1... · spanning tree of g. first, we...

84
Preliminaries Graphs G = (V, E), V : set of vertices E : set of edges (arcs) (Undirected) Graph : 1 3 2 4 5 V = {1, 2, 3, 4, 5} E = {(1, 3), (3, 2), (2, 4)} (i, j) = (j, i) 1

Upload: others

Post on 08-Aug-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Preliminaries • Graphs

G = (V, E), V : set of vertices

E : set of edges (arcs)

(Undirected) Graph :

1

32

4

5

V = {1, 2, 3, 4, 5}

E = {(1, 3), (3, 2), (2, 4)}

(i, j) = (j, i)

1

Page 2: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Directed Graph (Digraph):

1

32

4

5

V = {1, 2, 3, 4, 5}

E = {<1, 3>, <3, 2>, <2, 4>}

<i, j> ≠ <j, i> (arcs)

Multigraph : E is a multiset of edges

2

Page 3: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Loop : (i, i) or <i, i>

Simple Graph : no loops and no two edges connecting

the same pair of vertices

Complete Graph : each pair of distinct vertices is

connected by an edge

K4

Kn : the complete graph with n vertices

3

Page 4: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Bipartite Graph : V = X ∪ Y (X ∩ Y = φ)

(i, j) (or <i, j>) : i ∈ X, j ∈ Y or i ∈ Y, j ∈ X

Complete Bipartite Graph : each vertex of X is connected

to each vertex of Y

K3,4

X Y

Km,n : a complete bipartite graph with |X|=m and |Y|=n

4

Page 5: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Degree :

1

42

3

53

2

1 2

0

Let di be the degree of vertex i.

Theorem. ∑ ii V

d∈

= 2 ⋅ |E|.

5

Page 6: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

2

4

1

5

3

indegree outdegree

1 0 2 2 3 1 3 2 2 4 1 1 5 1 1

Let and denote the indegree and outdegree of

vertex i.

inid out

id

Theorem. = = |E|. ∑ ini

i Vd

∈∑ out

ii V

d∈

6

Page 7: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Subgraph : G1 = (V1, E1) is a subgraph of G = (V, E)

⇒ V1 ⊆ V and E1 ⊆ E

Isomorphism : G1 = (V1, E1) and G2 = (V2, E2) are

isomorphic iff there exists a one-to-one

and onto mapping f such that (i, j) ∈ E1

iff (f(i), f(j)) ∈ E2.

1

42

3

1

2

3

4G1 G2

f 12 3 4

12

4 3

G1 and G2 are isomorphic.

7

Page 8: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Relabel G1 according to f :

3

2 4

1

1

2

3

4

G3

1

4

3

2

G4

1

4

3

2

G3 and G4 are isomorphic.

8

Page 9: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

f 12 3 4

12 3 4

Relabel G3 according to f :

Path:

2, 1, 3, 5, 2, 1, 6 is a walk.

G4

1

4

3

2

3

1

4 2

1

53

4

2 6

9

Page 10: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

2, 1, 3, 4, 2, 5 is a trail (all edges are distinct) of

all vertices are distinct) of

m

ct) of

length 4. (circuit : all edges are distinct)

Connected Components :

G consists of three connected components.

Connected Graphs :

ff it consists of one single

connected component.

length 5 from 2 to 5.

2, 1, 3, 4, 6 is a path (

length 4 fro 2 to 6.

3, 4, 2, 1, 3 is a cycle (all vertices are distin

C2

C1

G

2

4 1

3

8

115

10 7

69C3

G is a connected graph i

10

Page 11: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Theorem. Let G = (V, E) be a connected graph wit

|V|

h

ns either a vertex of degree 1 or a

cycle (or both).

.

will be formed after going through at most |V| vertices.

G. The graph H = (V,

E−{(i, j)}) is also connected.

Proof.

> 1. G contai

Proof. Consider that every vertex in G has degree >1

If we travel G from an arbitrary vertex, then a cycle

Theorem. Let G = (V, E) be a connected graph that

contains at least one cycle. Let (i, j) ∈ E be an edge

that is on at least one cycle of

u i v

k

j

11

Page 12: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Let u, …, i, j, …, v be a path from u to v that goes

through the edge (i, j). There exists another path

u, …, i, …, k, …

, j, …, v from u to v that does not go

through (i, j).

nected undirected graph

contains at least n − 1 edges.

d from j to i for every pair of

distinct vertices i and j.

a strongly connected digraph

Theorem. There exists a connected undirected graph

of n vertices that contains exactly n − 1 edges, where n

≥ 1. Also, every n-vertex con

A digraph is strongly connected iff it contains directed

paths both from i to j an

21

34

12

Page 13: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Theorem. There exists a strongly connected digraph of

n vertices that contains exactly n arcs, where n ≥ 2. Also

every n-verte

,

x strongly connected digraph contains at

least n arcs.

Proof.

Th ion s assures

≥ 1 and ≥ 1 for every vertex i. Hence,

|E| = = ≥ n.

e definit of strongly connected digraph inid out

id

1∑ in

i

n

i=d

1∑ out

i

n

i=d

13

Page 14: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Underlying Graph :

G G’

G’ is the underlying graph of G

(do Exercise # 1)

14

Page 15: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Spanning Trees and Connectivity

• Breadth First Search (BFS)

Start at vertex 1.

{1} ⇒ {2, 3, 4} ⇒ {5, 6, 7} ⇒ {8, 9}

Vertex 10 is not reachable from vertex 1.

15

Page 16: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Start at vertex 1.

{1} ⇒ {2, 3, 4} ⇒ {5}

Vertices 6, 7, 8 are not reachable from vertex 1.

BFS can be used to determine the connected components

of an undirected graph.

16

Page 17: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

V = {1, 2, 3, …, 12}

Step 1. Perform BFS starting at an arbitrary vertex

(assume vertex 5).

{5, 6, 7} is reachable from vertex 5.

{5, 6, 7} is a connected component.

Step 2. Repeat Step 1 for an arbitrary vertex (assume

vertex 1) from the remaining vertices.

{1, 2, 3, 4} is a connected component.

Step 3. Repeat Step 1 for an arbitrary vertex from

the remaining vertices.

{8, 9, 10, 11, 12} is a connected component.

17

Page 18: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

• Depth First Search (DFS)

Start at vertex 1.

1 → 4 → 7 → 9 → 8 → 6 → 3 → 5 → 2

Start at vertex 1.

1 → 2 → 5 → 4 → 3

DFS can be also used to determine the connected

components of an undirected graph.

18

Page 19: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

• Spanning Trees

Let G = (V, E) be an undirected graph.

A subgraph G1 = (V1, E1) of G is a spanning tree of G

iff V1 = V and G1 is a tree.

BFS and DFS can define spanning trees, named

breadth-first spanning trees and depth-first spanning

trees, respectively.

19

Page 20: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Some breadth-first spanning trees of G :

Root : 1 8 6

20

Page 21: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Some depth-first spanning trees of G :

Root : 1 1 3

• Number of Spanning Trees

An edge e of G is said to be contracted if it is deleted

and its both ends are identified; the resulting graph

is denoted by G•e.

21

Page 22: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Let S(G) denote the number of spanning trees of G.

S(G) = S(G − e) + S(G • e) for any edge e of G.

S(G − e) : number of spanning trees that do not

contain e.

S(G • e) : number of spanning trees containing e.

22

Page 23: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

= 8.

23

Page 24: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

• Minimum (Cost) Spanning Trees

A weighted graph :

cost = 110 cost = 129

24

Page 25: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Build a minimum spanning tree :

Kruskal’s algorithm

Step 1. Sort edges nondecreasingly according to their costs.

(1, 6), (3, 4), (2, 7), (2, 3), (4, 7), (4, 5), (5, 7),

(5, 6), (1, 2)

Step 2. Examine the sorted sequence of edges sequentially.

An edge is selected if inclusion of it does not cause a

cycle.

25

Page 26: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Theorem. Kruskal’s algorithm can generate a

minimum spanning tree of G.

26

Page 27: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Proof. Clearly, the output of Kruskal’s algorithm is a

spanning tree of G. First, we assume that all edge

costs are distinct.

T : the spanning tree of G generated by Kruskal’s

algorithm.

T* : a minimum spanning tree of G.

Suppose that T contains e1, e2, …, en−1 and

T* contains ,*1e

*2e , …,

*1−ne , both in increasing

order of costs, where n is the number of vertices.

Assume e1 = *1e , e2 =

*2e , …, ek−1 =

*1−ke , ek ≠

*ke

(c(ek) < c( )). *ke

Insert ek into T* : a cycle is formed, in which there is

one edge, denoted by e*, that is not

in T and c(e*) > c(ek).

(If c(e*) < c(ek) (< c( )), then

e* =

*ke

*re = er for some 1 ≤ r ≤ k − 1)

27

Page 28: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Replace e* with ek

⇒ form a spanning tree with less cost than T*,

a contradiction

If distinct edges may have the same cost, then

c(ek) = c( ) (and c(e*)*ke = c(ek)) is possible.

For such a situation, replace e* with ek in T*, form a

new minimum spanning tree T** (having the same cost

as T*), and repeat the above process on T** .

Finally, either there is a contradiction or T = T**.

• Cycle Basis

28

Page 29: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

A, B : two sets.

Define A ⊕ B = A ∪ BB − A ∩ B. (⊕ : XOR)

Ex. c1 = {e1, e6, e7}, c2 = {e2, e7, e8}

⇒ c1 ⊕ c2 = {e1, e2, e6, e8} = c3

S = {c1, c2, …, ck} is a set of independent cycles iff no

cycle ci in S is the XOR of some other cycles in S.

Ex. {c1, c2} and {c1, c2, c4, c5} are two sets of

independent cycles.

A set S of independent cycles forms a cycle basis for a

graph G iff every cycle of G is the XOR of some cycles

in S.

Ex. {c1, c2, c4, c5} forms a cycle basis, where

c1 = {e1, e6, e7}, c2 = {e2, e7, e8},

c4 = {e4, e5, e9} and c5 = {e3, e8, e9}.

29

Page 30: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Find a cycle basis of G :

Step 1. Find a spanning tree T of G.

Step 2. Create cycles by adding edges of G that are

not in T.

30

Page 31: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Lemma. The XOR of two distinct cycles is a cycle or

a union of edge-disjoint cycles.

Proof : Refer to : Introduction to Combinatorial

Mathematics, proof of Theorem 7-9, by Liu.

Theorem. Suppose

T : the set of edges in any spanning tree (or

forest) of G = (V, E);

E − T : {a1, a2, …, ak};

ci : the unique cycle created by adding ai to T.

Then, {c1, c2, …, ck} is a cycle basis of G.

Proof : Each ci contains ai that is not in other cycles

⇒ {c1, c2, …, ck} is a set of independent cycles.

Let c : a cycle of G;

c ∩ (E − T) = { ,1i

a 2ia , …, ria };

: the cycle created by addingjic ji

a to T.

Then, c = 1i

c ⊕ 2ic ⊕ … ⊕ ric .

31

Page 32: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

If it is not true, then according to the lemma

c ⊕ ( 1ic ⊕ 2i

c ⊕ … ⊕ ric ) should be a cycle or

edge-disjoint cycles.

There is a contradiction, because all the edges in

c ⊕ ( 1ic ⊕ 2i

c ⊕ … ⊕ ric ) are contained in T.

• Connectivity

Let G = (V, E) be a connected undirected graph.

A subset S of V is called a vertex cut of G iff G − S =

(V − S, E − {(i, j) | i ∈ S or j∈ S, (i, j) ∈ E}) is disconnected.

Ex.

{2, 6} is a vertex cut. {1, 2} is not a vertex cut.

32

Page 33: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

A k-vertex cut is a vertex cut of k vertices.

The (vertex) connectivity of G is defined to be the

minimum k for which G has a k-vertex cut.

The connectivity of Kn, which has no vertex cut, is

equal to n − 1.

G is said to be k-connected if its connectivity ≥ k.

Ex.

2-connected

33

Page 34: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

1-connected 2-connected

Vertex 2 is called an articulation point.

v ∈ V is an articulation point of G iff {v} is a vertex cut.

A connected graph G is biconnected (2-connected) iff

G contains no articulation points.

• Finding Articulation Points

A graph and one (rooted at ) of its depth-first

spanning trees :

34

Page 35: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Redraw the spanning tree : ⎯⎯ tree edges

- - - - back edges

DFN (Depth First Number) : the visiting sequence of

vertices by DFS

L(i) : the least DFN reachable from i through a path

consisting of zero or more (downward) tree

edges followed by zero or one back edge.

35

Page 36: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Vertex i : 1 4 3 11 10 9 2 6 5 7 8

DFN(i) : 1 2 3 4 5 6 7 8 9 10 11

L(i) : 1 1 1 3 3 3 1 7 9 7 7

Y Y Y

(Y : an articulation point)

An edge (i, j) of G is a cross edge with respect to

a spanning tree of G iff i is neither an ancestor

nor a descendent of j.

Theorem. Suppose that G = (V, E) is a connected

graph and T is a depth-first spanning tree of G.

Then, G contains no cross edge with respect to T.

Proof. (i, j) ∈ T ⇒ (i, j) is not a cross edge.

Hence, consider (i, j) ∉ T.

Assume DFN(i) < DFN(j).

⇒ j belongs to the subtree of i

⇒ (i, j) is not a cross edge.

36

Page 37: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

According to the theorem, the root of a spanning tree

is an articulation point iff it has at least two children.

Theorem. Suppose that G = (V, E) is a connected

graph and T is a depth-first spanning tree of G.

Then, i ∈ V is an articulation point of G iff either

(a) i is the root of T and has at least two children, or

(b) i is not the root and has a child j with L(j) ≥ DFN(i).

Proof. We only prove (b).

j and its descendents will become isolated

if i is removed.

37

Page 38: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

• Edge Connectivity

Given G = (V, E), a subset S of E is an edge cut of G iff

G − S = (V, E − S) is disconnected.

A k-edge cut is an edge cut of k edges.

The edge connectivity of G is defined to be the

minimum k for which G has a k-edge cut.

G is said to be k-edge-connected if its edge

connectivity ≥ k.

Ex.

3-edge-connected

38

Page 39: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

(i, j) is a bridge of G iff {(i, j)} is an edge cut of G.

Ex.

√ : bridges

• Finding Bridges

A graph and one (rooted at ) of its depth-first

spanning trees :

39

Page 40: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Redraw the spanning tree :

Vertex i : 1 4 5 3 6 7 2 9 11 10 8

DFN(i) : 1 2 3 4 5 6 7 8 9 10 11

L(i) : 1 1 3 1 5 6 1 8 8 8 8

Y Y Y Y

(Y : a bridge)

40

Page 41: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Theorem. Suppose that G = (V, E) is a connected

graph and T is a depth-first spanning tree of G.

Let (i, j) ∈ E, and assume DFN(i) < DFN(j).

Then, (i, j) is a bridge of G iff L(j) = DFN(j).

Proof :

If L(j) = DFN(j), then T’ will be isolated from G after

removing (i, j).

(do Exercise # 2)

41

Page 42: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Paths

• Euler Trails, Euler Circuits

A trail (circuit) is called an Euler trail (Euler circuit)

of G = (V, E) iff it traverses each edge of G exactly

once.

Euler trail : 1, 2, 3, 1, Euler trail : 1, 2, 3, 5, 3,

5, 3, 4, 5 4, 5, 2

Euler circuit : 1, 2, 4, 3, 2, 6, 5, 4, 6, 1

42

Page 43: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Theorem. Let G = (V, E) be a connected undirected

graph. Assume |V| ≥ 1. Then,

(1) G has an Euler trail iff it contains either zero or

exactly two vertices with odd degrees;

(2) G has an Euler circuit iff all vertices have even

degrees.

Sketch of the proof.

(⇒) Trivial.

(⇐) An Euler trail is constructed as follows (an Euler

circuit is constructed similarly).

Step 1. Start from an odd-degree vertex (or any vertex

if no odd-degree vertex exists), traverse an

untraversed edge whenever it exists, and

finally terminate at a vertex whose incident

edges were all traversed.

43

Page 44: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

1 → 2 → 6 → 5 → 4 → 6 → 1

Step 2. Remove traversed edges and repeat Step 1 for

the remaining graph.

2 → 3 → 4 → 2

Step 3. Augment the trail obtained thus far with the

circuit obtained by Step 2.

1 → 2 → 3 → 4 → 2 → 6 → 5 → 4 → 6 → 1

Step 4. Repeat Step 2 and Step 3 until all the edges

were traversed.

44

Page 45: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Theorem. Suppose that G = (V, E) is a directed graph

and |V| > 1. Let and denote the indegree and

outdegree of vertex i, respectively. Then, G contains a

u-to-v Euler trail iff the underlying graph of G is

connected and either

inid out

id

(1) u = v and = for every i in V, or inid out

id

(2) u ≠ v, = for every i in Vinid out

id − {u, v},

= −inud out

ud 1, and invd = +out

vd 1.

Proof. Left as an exercise.

• Hamiltonian Paths, Hamiltonian Cycles

A path (cycle) is called a Hamiltonian path (cycle) of

G = (V, E) iff it goes through each vertex (exclusive of

the starting vertex and ending vertex) of G exactly

once.

45

Page 46: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

A Hamiltonian cycle : 1, 2, 3, 4, …, 20, 1

A Hamiltonian path : 1, 2, 3, 4, 5

46

Page 47: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

The problem of determining whether or not a graph

contains a Hamiltonian path (or cycle) is known to be

NP-complete.

There exist some sufficient (but not necessary)

conditions for an undirected graph having a

Hamiltonian path or cycle.

Theorem. Suppose that G = (V, E) is an undirected

graph and |V| = n ≥ 2. Let di be the degree of vertex vi.

If di + dj ≥ n − 1 for all vi, vj ∈ V and vi ≠ vj, then G has a

Hamiltonian path.

Proof. Refer to “Supplement of Graph Theory”.

Ex.

There exists a Hamiltonian path.

47

Page 48: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Theorem. Suppose that G = (V, E) is an undirected

graph and |V| = n ≥ 3. If for every 1 ≤ i ≤ ⎣(n − 1)/2⎦, G

has fewer than i vertices with degrees at most i, then

G contains a Hamiltonian cycle. When n is odd, G

contains a Hamiltonian cycle, even if G has (n − 1)/2

vertices of degrees (n − 1)/2.

Proof : Refer to : R. Brualdi, Introductory

Combinatorics, 1977.

Ex.

There exists a Hamiltonian cycle.

48

Page 49: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

• Shortest Paths

1-to-3 paths costs

1, 2, 3 15

1, 2, 5, 3 14 shortest

1, 3 20

49

Page 50: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Dijkstra’s shortest-path algorithm:

(choose the vertex with the minimum cost,

repeatedly, until all vertices are chosen)

vertex 1 chosen

vertex 2 chosen

vertex 5 chosen

vertex 3 chosen

50

Page 51: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

vertex 4 chosen

• Transitive Closure

Adjacency matrix:

51

Page 52: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

A(3, 4)=1 A(4, 2)=1

3 ⎯→ 4 ⎯→ 2

A2(3, 2)=1

A2(i, j) = 1 iff there exists an i-to-j walk of length 2.

52

Page 53: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

A3(i, j) = 1 iff there exists an i-to-j walk of length 3.

A4(i, j) = 1 iff there exists an i-to-j walk of length 4.

The transitive closure of A is

A+ = A1

∞∑i=

i.

A+(i, j) = 1 iff there exists an i-to-j walk of length ≥ 1.

53

Page 54: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Since an i-to-j walk of length ≥ |V| implies an i-to-j

walk of length ≤ |V| − 1,

The reflexive transitive closure of A is

A* = A0i

=∑ i

= A0 + A1

+ A2 + A3

+ A4

A*(i, j) = 1 iff there exists an i-to-j walk of length ≥ 0.

(do Exercise # 3)

54

Page 55: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Miscellaneous Topics

• Planar Graphs

There are many ways to draw a graph.

A graph is planar iff it can be drawn so that no two

edges cross. When a planar graph is drawn so that

no two edges cross (i.e., planar drawing), the plane

is partitioned into regions.

55

Page 56: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Theorem. Let G = (V, E) be a connected planar

graph. Consider any planar drawing of G. Let r

be the number of regions. The following hold.

(1) |V| − |E| + r = 2.

(2) |E| ≤ 3|V| − 6, if |E| ≥ 2.

Proof. Part (1). By induction on |E|.

Induction base. When |E| = 1, |V| = 2 and r = 1,

|V| − |E| + r = 2.

Induction hypothesis. Assume |V| − |E| + r = 2 for

|E| = m ≥ 1.

Induction step. Consider |E| = m + 1.

Case 1. G contains a vertex u with degree 1.

56

Page 57: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

remove u ⇒ (|V| − 1) − (|E| − 1) + r = 2

⇒ |V| − |E| + r = 2

Case 2. G contains no vertex of degree 1.

remove (u, v) ⇒ |V| − (|E| − 1) + (r − 1) = 2

⇒ |V| − |E| + r = 2

57

Page 58: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Part (2).

Case 1. r = 1.

|E| = |V| − 1 (G is a tree) (1)

|E| ≥ 2 ⇒ |V| ≥ 3 (2)

(1) and (2) ⇒ |E| ≤ 3|V| − 6

Case 2. r > 1.

every region is bounded by at least 3 edges

every edge is shared by at most 2 regions

⇒ every region “consumes” at least 3/2 edges

⇒ r ≤ |E|/(3/2) = 2|E|/3

|V| − |E| + r = 2 ⇒ |V| − |E| + 2|E|/3 ≥ 2

⇒ |E| ≤ 3|V| − 6

58

Page 59: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Corollary. Every planar drawing of a connected

planar graph has the same number of regions

(r = 2 − |V| + |E|).

Corollary. Suppose that G = (V, E) is a planar graph

with k connected components, and r is the number of

regions in any planar drawing of G. Then, |V| − |E| + r

= k + 1.

Ex. K5 has |V| = 5 and |E| = 10. Since |E| > 3|V| − 6, K5

is not planar.

Ex. K3,3 satisfies |E| ≤ 3|V| − 6, but it is not planar.

59

Page 60: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

A graph G is an elementary contraction of a graph H

iff G can be obtained from H by replacing two adjacent

vertices i and j of H by a single vertex K. All edges

incident on either i or j (but not both) in H are now

incident on K.

an elementary contraction

A graph H is contractible to the graph G iff G can be

obtained from H by a series of elementary contractions.

Theorem. A graph G is planar iff it does not contain a

subgraph that is contractible to K3,3 or K5.

60

Page 61: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Proof. Refer to : K. Wagner, “Über eine eigenschaft

der ebenen komplexe,” Math. Ann., vol. 114, pp. 570-

590, 1965, or

J. A. Bondy and U. S. R. Murty, Graph Theory with

Applications, pp. 156, 1976.

Two graphs are said to be homeomorphic if they can

be obtained from the same graph by adding vertices

onto some of its edges, or one can be obtained from

the other by the same way.

G1 and G2 are homeomorpic because they can be

obtained from G3 by adding vertices onto some of the

edges of G3. G1 and G3 (G2 and G3) are homeomorphic

because G1 (G2) can be obtained from G3 by adding

61

Page 62: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

vertices onto some edges of G3.

Theorem. A graph G is planar iff no subgraph of G is

homeomorphic to K5 or K3,3.

Proof. Refer to : N. Deo, Graph Theory with

Applications to Engineering and Computer Science,

1974, or F. Harary, Graph Theory, 1972.

• Matching

M ⊆ E is a matching in G = (V, E) if no two edges in

M are incident on the same vertex. Moreover, M is

a maximum matching if there exists no matching M’

with |M’| > |M| in G, and M is a perfect matching if

|V| = 2 × |M|.

{(1, 6), (2, 3), (4, 5)} is a

maximum matching and

a perfect matching.

62

Page 63: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Consider a bipartite graph G = (V, E), where

V = R ∪ S.

Let M be a matching in G.

|M| ≤ min{|S|, |R|}.

M is a complete matching iff |M| = min{|S|, |R|}.

{(2, 6), (3, 7), (4, 8), (5, 9)} is a complete matching.

63

Page 64: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Theorem. Suppose that G = (R ∪ S, E) is a bipartite

graph, where |R| ≤ |S| is assumed. For any W ⊆ R, let

ADJ(W) = { v | v is adjacent to a vertex in W}. Then,

G has a complete matching iff |W| ≤ |ADJ(W)| for any

subset W of R.

Ex.

Let W = {3, 4}.

⇒ ADJ(W) = {7}

⇒ |W| > ADJ(W)

⇒ no complete matching

64

Page 65: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

• Cliques, Independent Sets, Vertex Covers

A clique in a graph is a set of vertices every two of which are adjacent.

V’ = {1, 2, 3} is a clique of size 3.

An independent set in a graph is a set of vertices no two of which are adjacent.

V’ = {1, 2, 3} is an independent set of size 3.

65

Page 66: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

A vertex cover in a graph is a set of vertices such that each edge in the graph is incident with at least one vertex in the set.

V − V’ = {4, 5} is a vertex cover of size 2.

Theorem. Suppose that G = (V, E) is an undirected

graph and V’ ⊆ V. The following statements are

equivalent.

(1) V’ is a clique of G.

(2) V’ is an independent set of G .

(3) V − V’ is a vertex cover of G .

Proof. (1) ⇔ (2) ⇔ (3).

66

Page 67: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

• Maximum Flow and Minimum Cut

Transport network N = (V, E)

(1) Weighted, connected, directed.

(2) A pair of source node a and sink node z.

(3) A nonnegative capacity c(e) for each e ∈ E.

in

ad = out

zd = 0.

A flow is a function f from E to the set of nonnegative

integers, satisfying

capacity constraints: 0 ≤ f(e) ≤ c(e) for each e ∈ E, and

conservation constraints: ψ +(v) = ψ −(v) for v ∉ {a, z},

where ψ +(v) (ψ −(v)) is the total flow into (out of) v. 67

Page 68: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

An edge e is saturated if f(e) = c(e), and unsaturated else.

The total flow (or net flow) of f is defined to be

F = ψ −(a) = ψ +(z).

The maximum flow problem is to determine f so that

F is maximum.

f is not a flow, because ψ +(g) = 5 ≠ 4 = ψ −(g).

f is a flow, but F = 8 is not maximum.

F is bounded by min{c(a, b) + c(a, g), c(d, z) + c(h, z)} = 11.

68

Page 69: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Let S ⊂ V;

S = V − S;

a ∈ S;

z ∈S;

E(S; S) be the set of edges from S to S;

E( S;S) be the set of edges from S to S.

E(S; S) ∪ E( S;S) is called a cut (or a-z cut) of N.

Define c(S) =e E S S

c e∈∑( ; )

( ) to be the capacity of the cut

induced by S.

(1) S = {a, b}, S = {d, g, h, z}.

E(S; S) = {<a, g>, <b, d>, <b, h>}.

E( S;S) = {<g, b>}.

69

Page 70: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

{<a, g>, <b, d>, <b, h>, <g, b>} is a cut set.

c(S) = c(a, g) + c(b, d) + c(b, h) = 17.

(2) S = {a, b, g}, S = {d, h, z}.

E(S; S) = {<b, d>, <b, h>, <g, h>}.

E( S;S) = φ.

{<b, d>, <b, h>, <g, h>} is a cut set.

c(S) = c(b, d) + c(b, h) + c(g, h) = 15.

E(S; S) ∪ E( S;S) is a minimum cut if c(S) is minimum.

Lemma. (Conservation of Flow)

F = x y E S S

f x , y∈∑

( , ) ( ; )( ) −

y' x' E S Sf y' , x'∑

( , ) ( ; )( )

∈.

(Therefore, F ≤ c(S).)

Proof.

F = v V

f v , z∈∑

( ) − v' V

f z , v'∈∑

( ). (1)

For any r ∈ S − {z},

ψ +(r) = v V

f v , r∈∑

( ) = v' V

f r , v'∈∑

( ) = ψ −(r). (2)

70

Page 71: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

According to (1) and (2),

F = (v V

f v , z∈∑

( ) − v' V

f z , v'∈∑

( )) +

r S z∈ −∑

{ }(

v Vf v , r

∈∑

( ) − v' V

f r , v'∈∑

( ) ), (3)

which can be rewritten as

F = x y E S S

f x , y∈∑

( , ) ( ; )( ) −

y' x' E S Sf y' , x'∑

( , ) ( ; )(

∈), (4)

as explained below.

Consider each edge (x, y) ∈ E.

• x ∈ S, y ∈ S ⇒ f(x, y) is not counted in (3), (4).

• x ∈ S , y ∈ S ⇒ f(x, y) is counted twice, positively

and negatively, in (3), but not

counted in (4).

• x ∈ S, y ∈ S ⇒ f(x, y) is counted once, positively,

in (3), (4).

• x ∈ S , y ∈ S ⇒ f(x, y) is counted once, negatively,

in (3), (4).

71

Page 72: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Theorem. If F = c(S), then F is maximum and c(S)

is minimum.

Proof. According to the lemma above,

F’ ≤ c(S) = F ≤ c(S’)

for any total flow F’ and any (a ∈) S’ ⊂ V, which means

that F is maximum and c(S) is minimum.

Theorem. F = c(S) if and only if

(a) f(e) = c(e) for each e ∈ E(S; S);

(b) f(e) = 0 for each e ∈ E( S;S).

Proof. A consequence of Conservation of Flow (P. 70).

Ford & Fulkerson’s algorithm :

F = 8 F = 10 (augment (a, b, z) with 2)

72

Page 73: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

F = 12 F = 13 (augment (a, d, g, z) (augment (a, b, d, g, z)

with 2) with 1)

Consider the path (a, b, d, g, z) again.

(a, b), (d, g) and (g, z) are called forward edges, because

they have the same direction as the flow; (b, d) is called

a backward edge, because it has the opposite direction to

the flow.

A path in N is called an augmenting path, if its each

forward edge is unsaturated and its each backward

edge e has f(e) > 0.

The maximal increment of flow by an augmenting a-to-z

path P is equal to

ΔP = min{ min{c(e) − f(e) | e is a forward edge},

min{f(e) | e is a backward edge} }.

73

Page 74: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

The correctness of Ford & Fulkerson’s algorithm is

shown below.

Theorem. Suppose that f is a flow of N and P is an

augmenting a-to-z path. Define f + as follows:

f +(e) = f(e) + ΔP, if e is a forward edge;

f(e) − ΔP, if e is a backward edge;

f(e), if e is not an edge of P.

Then, f + is also a flow of N. The total flow increases by

ΔP.

Proof. Clearly, capacity constraints hold for all e ∈ E.

Conservation constraints also hold for all v ∈ V − {a, z}.

74

Page 75: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Theorem. F is maximum if and only if there is no

augmenting a-to-z path in N.

Proof. (⇒) trivial.

(⇐) To find an S so that F = c(S) is maximum, with

the following illustrative network.

S = {v | there is an augmenting a-to-v path in N}.

S = {a, b, d, g}. ( S contains z.)

⇒ f(e) = c(e) if e ∈ E(S; S), and f(e) = 0 if e ∈ E( S;S)

⇒ F = c(S)

75

Page 76: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Two flaws of Ford & Fulkerson’s algorithm :

Select (a, b, z) and (a, d, z) as augmenting paths.

Select (a, d, b, z) and (a, b, d, z), in the sequence, as

augmenting paths.

76

Page 77: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

(1) The worst-case time complexity of Ford &

Fulkerson’s algorithm is exponential.

(2) The capacities must be rational numbers. If they

are irrational numbers, then Ford & Fulkerson’s

algorithm may cause an infinite sequence of flow

augmentations, and the flow finally converges to

a value that is one fourth of the maximum total

flow.

Edmonds & Karp’s algorithm :

• Use BFS to find shortest augmenting paths

iteratively. (A forward edge is selected only

if it is unsaturated, and a backward edge e

is selected only if f(e) > 0.)

• If no further augmenting path is available, a

maximum flow is obtained.

Edmonds & Karp’s algorithm can overcome the two

flaws of Ford & Fulkerson’s algorithm.

77

Page 78: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Initially,

First iteration,

78

Page 79: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Second iteration,

Third iteration,

79

Page 80: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Fourth, iteration,

No further augmenting path can be found.

F* = 8 and S* = {a, b, d, j, k}.

80

Page 81: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

• Coloring, Chromatic Number, and Chromatic Polynomial

A proper coloring of a graph G is an assignment of

colors to the vertices of so that no two adjacent

vertices are assigned with the same color.

The chromatic number of G, denoted by χ(G), is the

smallest number of colors needed to properly color G.

orable iff it can be properly colored

with k colors.

Ex. The following graph G is 3-colorable. Since it

contains a K3, it has χ(G) ≥ 3. Therefore, χ(G) = 3.

G

A graph is k-col

Ex. χ(Kn) = n.

81

Page 82: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Theorem. An undirected graph G = (V, E) is bipartit

iff G contains no cycle of odd length.

e

to

ual to the number of functions

f: V → λ E

When λ ≥ n, P(Kn, λ) = λ(λ − 1)(λ − 2) … (λ − n + 1).

Ex. If G is a path on n vertices, then P(G, λ) = λ(λ − 1)n−1.

Define P(G, λ) to be the number of different ways

properly color G with at most λ distinct colors.

Considering λ a variable, P(G, λ) is a polynomial

function, called the chromatic polynomial of G.

The value of P(G, λ) is eq

{1, 2, …, } so that f(u) ≠ f(v) if (u, v) ∈ .

Ex. P(Kn, λ) = 0 as λ < n.

Ge : d by deleting an edge e of G.

: the graph obtained from G by identifying the two

end vertices of e.

the graph obtaine

e' G

82

Page 83: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

Theorem. P(Ge, λ) = P(G, λ) + P( , λ). e'G

(or P(G, λ) = P(Ge, λ) − P( , λ).) e'G

Ex. Compute P(G, λ) for G being a cycle of length 4.

P(Ge, λ) = λ(λ − 1)3; P( , λ) = λ(λe'G − 1)(λ − 2).

P(G, λ) = λ(λ − 1)3 − λ(λ − 1)(λ − 2)

= λ4 − 4λ3

+ 6λ2 − 3λ.

P(G, 1) = 0, P(G, 2) = 2 ⇒ χ(G) = 2.

83

Page 84: Basic Graph Theory - 國立臺灣大學discrete/course/Part_1... · spanning tree of G. First, we assume that all edge costs are distinct. T: the spanning tree of G generated by Kruskal’s

The constant term in P(G, λ) is 0, for otherwise

P(G, 0) ≠ 0.

When |E| > 0, the sum of the coefficients in P(G, λ) is 0,

for otherwise P(G, 1) ≠ 0.

(do Exercise # 4)

84