Professional Documents
Culture Documents
Topics
1. Graphs
1.1. Types of Graphs
1.2. Basis of Graphs
1.3. Bipartite Graphs
1.4. Graphs as Matrices
1.5. Isomorphisms
1.6. Connectivity
1.7. Euler Paths
1.8. Hamilton Paths
1.9. Planar Graphs
2. Trees (Brie
y)
2.1. Basis
2.2. Spanning Trees
1 Graphs
Graphs are discrete structures consisting of vertices and edges that connect these vertices.
|-> Figure (g. 1 p. 430)
Denition 1.1
Simple Graphs
simple
graph
= (V ,E ) consists of
In this situation, we need a multi-graph which allows multiple edges between the same pairs of vertices.
Denition 1.2
Multigraph
1. A multigraph
, u 6= v g.
Pseudograph
2 g.
( ) = f g for some 2
e
Directed Graphs
graph
= f (v1,
v2)
j v1, v2 2
and v1
6= v2 g.
Note that this denition of directed graphs allows a loop but does not
allow multiple edges.
Denition 1.5
A directed
Directed Multigraphs
multigraph
2 g.
V
We shall use the term graph to describe graphs with directed or undirected
edges, with or without loops and multiple edges.
Denition 1.6
and v.
incident to a vertex.
Denition 1.7
The degree
Degree
deg(v)
of a vertex
edges incident with it, except that a loop at a vertex contributes twice to
the degree of that vertex.
Example 1.1
Degree
In
deg(a)
= 2,
deg(b)
deg(c)
deg(f )
= 4,
deg(d)
= 1,
deg(e)
=3
and deg(g) = 0.
In
= (V ,E ) ?
Each edge contributes 2 to the sum of the degrees of the vertices since an
edge is incident with exactly two vertices.
This means that the sum of the degrees of the vertices is twice the number
of edges.
Theorem 1.1
X
v
deg(v):
Note that this applies even if multiple edges and loops are present.
This theorem shows that the sum of the degrees of the vertices of an
undirected graph is even.
Denition 1.8
is said to
is called the
Denition 1.9
deg
Denition 1.10
Complete Graphs
contains exactly
one edge
Denition 1.11
The cycle
2g,
Cn
Cycle graphs
2, v3g, ..., fv 1, v
n
g and f
vn
, v1g.
Cn
by new edges.
8
3,
4,
5 and W6 .
Qn
Two vertices are adjacent i the bit strings that they represent dier in
exactly one bit position.
Sometimes, a graph has the property that its vertex set can be divided
into two disjoint subsets such that each edge connects a vertex in one subset
to a vertex in the other subset.
Denition 1.12
Bipartite graphs
Example 1.2
Bipartite
Denition 1.13
Km;n
2 3,
3 3,
35
and K2 6.
;
1.4 Subgraphs
When edges and vertices are removed from a graph, without removing
endpoints of any remaining edges, a smaller graph is obtained.
of a graph
subgraph
and F
Subgraphs
G
= (V ,E ) is a graph
= (W ,F ) where
Denition 1.15
Union of graphs
1 = (V1,
1) and
2 = (V2 ,
2 ) is the
2.
Consider the following gure which shows an example of the union of two
graphs.
|-> Figure (g. 15 p. 447)
Another way to represent a graph with no multiple edges is to use adjacency lists,
the graph.
Adjacency Matrices
Suppose that the vertices of G are listed arbitrarily as v1, v2, ..., v .
n
The adjacency matrix A of G wrt this listing of vertices, is the n n zeroone matrix with 1 as its (i,j )th entry when v and v are adjacent, and 0 as
i
with n vertices.
aj i
zero-one matrix, since the (i,j )th entry of this matrix equals the number of
edges that are associated to f a , a
i
g.
12
Incidence Matrices
Suppose that v1, v2, ..., v are the vertices and e1, e2, ..., e are the edges
n
of G.
The incidence matrix with respect to this ordering of
m
and
matrix M = [m ] where
ij
mij
8
><1
=
>:0
when edge
ej
otherwise
is incident with
vi
is the
1 1 1 0 0 0 0
2 0 0 1 1 0 1
3 0 0 0 0 1 1
4 1 0 1 0 0 0
5 0 1 0 1 1 0
Incidence matrices can also be used to represent multiple edges and loops.
v
with identical entries, since these edges are incident with the same pair of
vertices.
Loops are represented using a column with exactly one entry equal to 1,
corresponding to the vertex that is incident with this loop.
14
1 1 1 1 0 0 0 0 0
2 0 1 1 1 0 1 1 0
3 0 0 0 1 1 0 0 0
4 0 0 0 0 0 0 1 1
5 0 0 0 0 1 1 0 0
We often need to know whether it is possible to draw two (possibly different) graphs in the same way.
Denition 1.18
edges.
Graph Isomorphism
The simple graphs G1 = (V1, E1) and G2 = (V2, E2) are isomorphic if there
is a bijection f from V1 to V2 with the property that
for all a and b in V1,
a
Example 1.3
Graph Isomorphism
In G, the adjacent vertices are f(u1, u2), (u1, u3), (u2, u4), (u3, u4) g.
which are preserved in H by f as f (v1, v4), (v1, v3), (v4, v2), (v3, v2) g.
However, we can often show that two simple graphs are not isomorphic
by showing that they do no share a property that isomorphic simple graphs
must both have.
Example 1.4
Graph Isomorphism
has
However, when those three criteria hold for two graphs, they do not
There are no useful sets of such criteria known that can be used to determine whether simple graphs are isomorphic.
Consider the following graphs.
Figure (g 10 p. 461)
and
isomorphic.
u, x,
or
1.7 Connectivity
Many problems can be modeled with paths formed by traveling along the
edges of graphs.
17
Denition 1.19
1) A
path
Path
1, in an undirected graph is
( 1) = fx0, x1g,
f e
( 2) = fx1, x2g,
f e
.
.
.
( ) = fx 1, x
f en
where x0 = u and x = v.
n
2) When the graph is simple, we denote this path by its vertex sequence x0,
x
1, ..., x .
n
3) The path is a circuit if it begins and ends at the same vertex, that is, if
u
= v.
4) A path or circuit is simple if it does not contain the same edge more than
once.
Example 1.5
, , , ,
, , , ,
The path
a
, b, e, d, a, b is not simple.
Similar denitions for paths and circuits can be dened for directed graphs.
Denition 1.20
A path of length
where
( 1) = (x0, x1),
f e
( 2) = (x1, x2),
f e
.
.
.
( ) = (x 1, x )
f en
where x0 = u and x = v.
n
Note that each pair of vertices which forms a step in a path here is
19
Denition 1.21
An
Connected
graph is called
undirected
connected
Example 1.6
Connected
Obviously,
1 , G2 and
20
Denition 1.23
1) If the removal of a vertex and all edges incident with it produces a graph
with more connected components than the original graph, then such a vertex
is called a cut
vertex.
2) If the removal of an edge creates a graph with more connected components, then such an edge is called a cut
edge.
edges.
|-> Figure (p. 6 Kenneth's transparency)
are b,
c, e.
Denition 1.24
connected
connected
21
The town of Konigsberg, Prussia was divided into four sections by the
branches of the Pregel river.
Denition 1.25
Euler Circuit
An
in a graph
Euler circuit
.
22
Euler solved the problem by showing that there is no such Euler circuit
in the graph representing the bridges.
2 Trees
A connected graph that contains no simple circuits is called a tree.
It can be traced back to 1857 when the English mathematician Arthur
Cayley used tree to analyse chemical compounds.
Denition 2.1
Tree
Since a tree cannot have a simple circuit, a tree cannot contain multiple
edges or loops.
1 and
2 are trees, since they both are connected and do not have a
simple circuit.
23
d
, e is a simple circuit.
Denition 2.2
two
unique simple
of its vertices.
Forest
A forest is a graph that are not necessarily connected but contains no simple
circuits, and each of its connected components is a tree.
It follows from the above theorm that there is a unique path from the
root to each vertex of the graph.
24
Denition 2.3
1) If
Some terminalogies
parent
of
is the
vertices.
Denition 2.4
M-ary Trees
1) A rooted tree is called an m-ary tree if every internal vertex has no more
than m children.
2) The tree is called a full m-ary tree if every internal vertex has exactly m
children.
3) An m-ary
tree
tree.