Вы находитесь на странице: 1из 4

ECNG2013

LECTURE 11
Graphs and Trees (II)
Definitions
A simple graph is a graph with no loops or parallel edges. In a simple graph,
an edge with endpoints v and w is denoted by [v, w]. (v, w) is used to denote
a directed edge from v to w.
A graph H is said to be a subgraph of a graph G if and only if, every vertex in
H is also a vertex in G, every edge in H is also an edge in G, and every edge
in H has the same end points as in G.
Let G be a graph and v a vertex of G. Then the degree of v denoted by deg(v)
equals the number of edges that are incident on v, with an edge that is a loop
counted twice. The total degree of G is the sum of the degrees of all the
vertices of g.
Example
Draw a simple graph connecting the five vertices v1 , v 2 , v 3 , v 4 and v 5
Draw two subgraphs of G
v3
v2

v1
v3

v1

v4

v2
v5

v3

v4

v5

v4

Theorem
If G is any graph, then the sum of the degrees of all the vertices of G equals twice
the number of edges of G.
Proof
Let G be any particular but arbitrarily chosen graph. If G does not have any vertices,
then it does not have any edges and so theorem is true since 2 X 0 = 0.

Suppose G has n vertices, v1 , v 2 , ........, v n , and m edges, one can claim that each
edge of G contributes 2 to the total degree of G.
For instance, if e is an arbitrarily chosen edge with end points vi and v j , this edge
contributes 1 to the degree of vi and 1to the degree of v j . If i = j, because an edge
that is now a loop is counted twice in computing the degree of the vertex on which
it is incident, proposition is also true there.
It therefore follows that claim that e contributes 2 to the total degree of G is true.
Since e is arbitrarily chosen, this shows that it is also true for each edge of G.
Hence total degree of G = 2 x Number of edges of G.

Walks, Paths, Trails, Circuits


Definitions
Let G be a graph and v and w be vertices of G
A walk from v to w is a finite alternating sequence of adjacent vertices and
edges of G. Thus a walk has the form v 0 e1v1e 2 ,....., v n 1 , e n , v n where v 0 =w

and v n =v. If the beginning vertex is the same as the ending vertex, we say
that the walk is closed. The length of the walk is the number of edges in the
walk. A walk of length 0 is called a trivial walk.
A trail from v to w is a walk from v to w that does not contain a repeated
edge
A path is a walk with no repeated vertices
A circuit is a closed trail.
A cycle is a non trivial circuit in which the only repeated vertex is the first and
last
A Hamiltonian circuit for a graph G is a cycle that includes every vertex of G.
i.e. It is a sequence of adjacent vertices and distinct edges in which every
vertex of G appears exactly once except for the first and the last.

Definition
Let G be a graph. Then G is Eulerian if there is a circuit in G that involves every
edge exactly once. This circuit is called an Eulerian circuit
Theorem
A graph G has an Euler circuit if, and only if, G is connected and every vertex of G
has an even degree
Proof
Suppose that G is a graph that has an Euler circuit. Let v stand for any arbitrarily
chosen vertex of G. Since the Euler circuit contains every edge of G, it contains all
the edges incident on v.
Suppose you take a journey that begins in the middle of one of the edges adjacent
to the start of the Eulerian circuit and continues around the Euler circuit to the end

in the middle of the starting edge. Each time v is entered by travelling along one
edge it is immediately exited by travelling along another edge.
Because the Euler circuit uses every edge of G exactly once, every edge incident on
v is traversed exactly once in this process. Hence the edges incident on v occur in
entry exit pairs and consequently the degree of v must be a multiple of two. Hence
the degree of v is even.
Example
1
2

6
5

(a) Find two different circuits each with a length of 7 that begin and end at 1
(b) Find a walk from 1 to 8 that uses five edges and is not a trail.
(c) Find a trail from 3 to 5 that uses all the edges incident with 4
(d) Find a Hamiltonian circuit starting and ending at 8
(e) Find a cycle of length 4

Theorem
A connected non Eulerian graph has an Eulerian trail if, and only if, G has exactly
two nodes of odd degree. Moreover, the trail must begin and end at these two
nodes.
Example
Find an Eulerain trail for the graph below
Add an edge to make the graph Eulerian
1

5
6

Example
The graph below is a map showing four cities and the distance in km between them.
Suppose that a salesman must travel to each city exactly once starting and ending
in city a. Which route from city to city will minimize the total distance that must be
travelled.

B
30

30

50

35

25

40
D

Solution
The problem can be solved by writing all possible Hamiltonian circuits starting and
ending at A and calculating the total distance travelled for each.
1.
2.
3.
4.
5.
6.

ABCDA - 30 + 30 + 25 + 40 = 125
ABDCA - 30 + 35 + 25 + 50 = 140
ACBDA 50 + 30 + 35 + 40 = 155
ACDBA 50 + 25 + 30 + 40 = 140
ADBCA 40 + 35 + 30 + 50 = 155
ADCBA 40 +25 + 30 +30 =125

Hence either route ABCDA or ADCBA gives a minimum total distance of 125 km.

Вам также может понравиться