DirectFileTopicDownload 1
DirectFileTopicDownload 1
1 Introduction
2 Trees
3 Algorithm
4 References
Graph theory was originated from the Konigsberg Bridge Problem, where
two islands linked to each other and to the banks of the Pregel River by
seven bridges. The problem was to begin at any of the four land areas, walk
across each bridge exactly once and return to the initial point. This problem
was solved in 1736 by Euler. In 1847, Kirchhoff developed the theory of trees
to solve the system of linear equations which give the current in each branch
and around each circuit of an electric network. In 1857, Hamilton presented
that Hamilton s game. The game’s object is finding a Hamiltonian cycle
along the edges of a dodecahedron such that every vertex is visited only
once and the end vertex is same as the initial vertex.
v r s
v4 e
3
A labelled graph is a graph in which every vertex and every edge is labeled.
most of the times, a graph means a labelled graph.
v1 v2 v5
v6
v7 v
8
H3
Walk: u a v f y g w b v f y .
Trail: u e y f b w g y d x .
Path: u a v f y g w .
A trail whose origin is same as terminus, is called a circuit and such a path
is called a cycle.
v v6 v2
v6 2
v5 v5 v
3
v
3
v4 v
4
%EB.IT#B keatABa.eg- f-
degG v2 = degG v6 = 2, degG v3 = degG v4 = 3, degG v5 = 1. Here, v1 is the
isolated vertex and v5 is the pendant vertex.
v2 v4
v5
V1
v3 v6
G
Radius of G:
rad(G) = min {eG (v )}.
v œV (G)
Diameter of G:
diam(G) = max {eG (v )}.
v œV (G)
eG (v1 ) = 1
eG (v2 ) = 2
eG (v3 ) = 2
eG (v4 ) = 2
eG (v5 ) = 2.
rad(G) = 1 and diam(G) = 2.
v1 is the central vertex in G.
Example 2:
eG (v1 ) = 4 eG (v5 ) = 2
eG (v2 ) = 4 eG (v6 ) = 3
eG (v3 ) = 3 eG (v7 ) = 4
eG (v4 ) = 2 eG (v8 ) = 4.
rad(G) = 2 and diam(G) = 4.
Center of G = {v4 , v5 }.
Example 3:
G
eG (v1 ) = 2
eG (v2 ) = 1
eG (v3 ) = 1
eG (v4 ) = 2
eG (v5 ) = 2.
rad(G) = 1 and diam(G) = 2.
Center of G = {v2 , v3 }.
Theorem
Result:
GABBAR
Let G be a (p, q) graph.The sum of the degrees of vertices of a graph G is
q
twice the number of edges, deg(v ) = 2q, v œ V
Proof.
Since every edge is incident with two vertices, each edge contributes 2 to
the sum of degrees of the vertices. Hence, the BEGGED
theorem.
result.
Proof.
Let Se = Sum of all degree of all even degree vertices. Let So = Sum of all
degree of all odd degree vertices. By definition, So + Se = 2q. i.e,
So = 2q ≠ Se = even. Each term in the sum So is odd. Therefore, So can
be even, only if even number of terms in So . Hence, the←BzBBzq-
theorem.
result.
v3 v v3
v 6
6
v v4
v5 v 5
4
Theorem
Result:
Browses
A graph is bipartite if and only if all its cycles are even.
of even length.
BE
Proof.
Let G be a connected bipartite graph. Then its vertex set V can be par-
titioned into two sets V1 and V2 such that every edge of G joins a vertex
of V1 with a vertex of V2 . Thus, every cycle v1 , v2 , ...vn , v1 in G necessarily
has its oddly subscripted vertices in V1 (say). i.e,v1 , v3 , ... œ V1 and other
vertices v2 , v4 , ... œ V2 . In a cycle v1 , v2 , ...vn , v1 : vn , v1 is an edge in G.
Since, v1 œ V1 we must have vn œ V2 . This implies n is even. Hence,the
length of the cycle is even.
Proof.
Let G be a graph with six vertices. Let v be any vertex in G. Since v is
adjacent to other five vertices either in G or in G. We assume that, v is
adjacent with v1 , v2 , v3 in G. If any 2 of these vertices say v1 , v2 are
adjacent then v1 , v2 , v form a triangle in G. If no two of them are adjacent
in G then v1 , v2 , v3 are the vertices of a triangle in G.
Proof.
Let G be a (p, q) graph. Number of edges in Kp = p(p ≠ 1)/2 = pC2
Since G is self complementary, number of edges in G = number of edges
in G = q
Number of edges in Kp = number of edges in G + number of edges in G.
∆ Number of edges in G = p(p ≠ 1)/2 - q
∆ q = p(p ≠ 1)/2 ≠ q, ∆ 4q = p(p ≠ 1)
Therefore, q = p(p-1)/4
∆ 4/p or 4/(p ≠ 1)
∆ p = 4n or p ≠ 1 = 4n
∆ p = 4n or p = 4n + 1
Proof.
Suppose that the graph G is disconnected. Let us assume that G has
two(or more) components say C1 and C2 . Suppose that a component C1
has a vertex of minimum degree (p ≠ 1)/2. Then, C1 must contain atleast
[(p ≠1)/2+1] vertices. Similarly, suppose that a component C2 has a vertex
of minimum degree (p ≠1)/2. Then, C2 must contain atleast [(p ≠1)/2+1]
vertices. Now, total number of vertices in G is equal to [(p ≠ 1)/2 + 1 +
(p ≠ 1)/2 + 1] = p ≠ 1 + 2 =p + 1 which is a contradiction to the fact that
G has p vertices. Hence, G is connected.
Proof.
Let x and y be any two vertices in G. Since diam(G) Ø 3, there exist
vertices u and v at distance 3 in G. Hence, uv is an edge in G. Since u
and v have no common neighbour in G, both x and y are each adjacent to
u or v in G. It follows that d(x , y ) Æ 3 in G and hence d(G) Æ 3)
Proof.
Let G be a self complementary graph. Clearly, G cannot have diameter 1.
Since G ≥= Kn which is not self complementary graph. Hence, self
complementary graphs have diameter atleast 2. Suppose that
diam(G) > 3. By the above goes
theorem,
result diam(G) Æ 3. Hence, diameter of
every self complementary graph is either 2 or 3.
Proof.
If G itself is connected, there is nothing to prove. Suppose that the graph
G is disconnected and has two components C1 and C2 . Let u and v be
any two vertices, we have the following cases.
(i) If u and v are in different components and are not adjacent in G.Then
u and v are adjacent in G. We have, uv path, hence G is connected.
(ii) If u and v belong to the same component but they are not adjacent
in G. Hence, they are adjacent in G. Hence, we have uv path.
(iii) Suppose that u and v are adjacent in G(Obviously, they belong to the
same component).Then we can find w in another component (which
does not contain u and v ). We have a uv path via w in G. That is,
u ≥ w and v ≥ w .
V
V
5 2 S T
0 1 0 0 1
W1 0 1 0 0X
W X
W X
A(G)= W0 1 0 1 0X
V V
4 3
W X
U0 0 1 0 1V
1 0 0 1 0
Figure: Graph G and its adjacency matrix A(G)
Figure: Trees
Proof.
Let G be a tree then G is connected. Hence, there exist atleast one path
between every pair of vertices. Suppose that between two vertices say u and
v , there are two distinct paths then union of these two paths will contain
a cycle; a contradiction. Thus, if G is a tree, there is atmost one path
joining any two vertices. Conversly, suppose that there is a unique path
between every pair of vertices in G.Then G is connected. A cycle in the
graph implies that there is atleast one pair of vertices u and v such that
there are two distinct paths between u and v . Which is not possible because
of our hypothesis. Hence, G is acyclic and therefore it is a tree.
Proof.
TheBB←BBoBBz@
theorem
result will be proved by induction on the number of vertices.
If p = 1, we get a tree with one vertex and no edge. If p = 2, we get a tree
with two vertices and one edge. If p = 3, we get a tree with three vertices
and two edges. Assume that, the statement is true with all tree with k
vertices (k < p). Let G be a tree with p vertices. Since G is a tree there
exist a unique path between every pair of vertices in G. Thus, removal of an
edge e from G will disconnect the graph G. Further, G ≠e consists of exactly
two components with number of vertices say m and n with m +n = p. Each
component is again a tree. By induction, the component with m vertices
has m ≠ 1 edges and the component with n vertices has n ≠ 1 edges. Thus,
the number of edges in G = m ≠ 1 + n ≠ 1 + 1 = m + n ≠ 1 = p ≠ 1.
Proof.
The result is obvious for the trees K1 and K2 . We show that any other
tree T has the same central vertices as the tree T1 obtained by removing
all end vertices of T . Clearly, the maximum of the distances from a given
vertex u of T to any other vertex v of T will occur only when v is an end
vertex. Thus, the eccentricity of each vertex in T1 will be exactly one less
than the eccentricity of the same vertex in T . Hence, the vertices of T
which possess minimum eccentricity in T are the same vertices having
minimum eccentricity in T1 . That is, T and T1 have the same center.
v6 v7 v8 v2
V
12 V9
v5 v
3
V V10
11
v4
Proof.
Suppose that G is connected and Eulerian. Since G has an eulerian circuit
which passes through each edge exactly once,goes through all vertices and
all of its vertices are of even degree.
Conversly, Let G be a connected graph such that every vertex of G is of even
degree. Since, G is connected, no vertex can be of degree zero. Thus, every
vertex of degree Ø 2, so G contains a cycle. Let C be a cycle in a graph
G. Remove edges of the cycle C from the graph G. The resulting graph
(say G1 ) may not be connected, but every vertex of the resulting graph is
of even degree.
20 19
9 10
8 11
1 7
2
3
6
4
12
5
13 18
15 14
16
17
(b)
(a)
B
C
5
7 3
A
10 8
4 5
S T
6 6
E 0 7 Œ 6 Œ
0 5 10X
D WŒ
11 W Œ X
W X
D(G) = W 12 6 0 Œ 3X
W X
U 4 5 Œ 0 6V
11 Œ 8 Œ 0
Figure: Graph G and its distance matrix D(G)
Vertex in U A C D E
bestd Œ 5 Œ 10
tree B B B B
Vertex in U A D E
bestd 17 Œ 8
tree C B C
(4) min bestd = 8; s = E .
U = {A, D}, K = {B, C , E }.
Vertex in U A D
bestd 17 Œ
tree C B
Vertex in U D
bestd 23
tree A
S T
0 5 6 Œ 17 Œ
W3 0 4 Œ Œ 7X
W X
WŒ Œ 0 6 Œ 11X
W X
D(G) = W X
W11 Œ 7 0 9 4X
W X
UŒ Œ Œ Œ 0 5V
11 Œ Œ 9 4 0
Figure: GraphG and its distance matrix D(G)
Vertex in U a b f g h
bestd Œ Œ 6 Œ 11
tree c c c c c
Vertex in U a b g h
bestd 17 Œ 15 10
tree f c f f
(4) min bestd = 10; s = h.
U = {a, b, g}, K = {c, f , h}.
Vertex in U a b g
bestd 17 Œ 14
tree f c h
[3]