0% found this document useful (0 votes)
104 views18 pages

Module1 BCS405B New 1

The document covers the fundamentals of graph theory, including definitions of various types of graphs such as undirected, bipartite, multigraphs, and simple graphs. It explains key concepts like incidence, adjacency, vertex degree, isolated and pendent vertices, and regular graphs, along with examples and review questions for each topic. Additionally, it discusses properties related to the degrees of vertices and provides proofs for certain graph characteristics.

Uploaded by

ranjitha1065r
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views18 pages

Module1 BCS405B New 1

The document covers the fundamentals of graph theory, including definitions of various types of graphs such as undirected, bipartite, multigraphs, and simple graphs. It explains key concepts like incidence, adjacency, vertex degree, isolated and pendent vertices, and regular graphs, along with examples and review questions for each topic. Additionally, it discusses properties related to the degrees of vertices and provides proofs for certain graph characteristics.

Uploaded by

ranjitha1065r
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

GRAPH THEORY (BCS405B) 2024

MODULE-1
Introduction to Graphs: Introduction- Basic definition – Application of graphs – finite, infinite and bipartite
graphs – Incidence and Degree – Isolated vertex, pendant vertex and Null graph. Isomorphism, sub-graphs,
walks, paths and circuits, connected graphs, disconnected graphs and components.

Lecture 1: Introduction to Graphs using relation on a set.

Undirected Graph: Let 𝑉 be a nonempty set, and 𝐸 be a set of unordered pairs of elements of 𝑉.
Then the pair 𝐺( 𝑉, 𝐸 ) is called graph.
𝑉 is called set of vertices (or nodes) and 𝐸 , the set of edges (or arcs) .

Or 𝐺( 𝑉, 𝐸 ) is said to be a graph, if 𝑉 = {𝑣1 , 𝑣2 , ⋯ } is set of vertices, and 𝐸 = {𝑒1 , 𝑒2 , ⋯ } is set of edges


such that each edge 𝑒𝑘 is identified with unordered pair {𝑣𝑖 , 𝑣𝑗 } of vertices. Vertices 𝑣𝑖 , 𝑣𝑗 associated with
edge 𝑒𝑘 are called end vertices of edge 𝑒𝑘 .

Loop: An edge of the form {𝑎, 𝑎} is called loop.

Loop free graph: A graph containing no loop.

Multigraph: If there exists two or more (in digraph, in the same direction) edges between any two vertices
(Parallel edges) then the graph is called multigraph.

Simple graph: A loop free graph without multiple edges is called simple graph otherwise general graph.

A graph is also called a linear complex, a 1-complex, or a one-dimensional complex.

A vertex is also referred to as a node, a junction, a point, , 0-cell or a 0-simplex.

An edge is also called a line, an arc, an element or a 1-simplex.

Examples of graphs.

1. Graph with no edges:

2. Graph containing a loop:

3. Multigraph:

4. Simple graph:

DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.


1
GRAPH THEORY (BCS405B) 2024

Consider the graph 𝐺( 𝑉, 𝐸 ) with 𝑉 = {𝑣1 , 𝑣2 , 𝑣3 , 𝑣4 , 𝑣5 , 𝑣6 } and 𝐸 = {𝑒1 , 𝑒2 , 𝑒3 , 𝑒4 , 𝑒5 , 𝑒6 , 𝑒7 , 𝑒8 }

𝑣1 𝑒1 𝑣2
𝑒8

·
𝑒2 𝑒5
𝑒6 𝑣3
𝑒3

𝑣6
𝑒4 𝑒7
𝑣4 𝑣5

Fig: 1.1

Edges 𝑒2 and 𝑒3 are parallel edges. Edge 𝑒8 is a loop.

Review questions:

1. Give an example of a graph containing a loop and parallel edges.

2. In a graph 𝐺( 𝑉, 𝐸 ) why the vertex set 𝑉 is non-empty, but E may be empty?

3. If 𝐸 be a set of ordered pairs of elements of 𝑉 then how we can represent edges.

4. In drawing a graph, whether the edge should be a straight line?

5. Is the length of an edge is defined? (Edges are long or short)

6. Whether two edges intersect between the vertices?

DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.


2
GRAPH THEORY (BCS405B) 2024

Lecture 2: Finite graph and infinite graphs

Finite graph: A graph 𝐺( 𝑉, 𝐸 ) is said to be finite if |𝑉| and | 𝐸| are both finite, otherwise infinite graph.

Bipartite graph: Suppose a simple graph G is such that its vertex set V is the union of its mutually disjoint non-
empty subsets V1 and V2 which are such that each edge in G joins a vertex in V1 and a vertex in V2 . Then G is
called bipartite graph. If E is the edge set of the graph, then the graph is denoted by G( V1 , V2 ; E). The set V1
and V2 are called bipartite (or partitions) of the vertex set V .
𝑎 𝑐
Example: 𝑒

𝐺 𝑓
𝑏 𝑑 𝑔

Clearly the vertex set 𝑉 = {𝑎, 𝑏, 𝑐, 𝑑, 𝑒, 𝑓, 𝑔} can be partitioned into two nonempty subsets 𝑉1 = {𝑎, 𝑑, 𝑓} and
𝑉2 = {𝑏, 𝑐, 𝑒, 𝑔}, such that each edge in G with one end vertex in V1 and another end vertex in V2 .
Or there is no edge between the any two vertices of V1 and any two vertices of V2 .
Therefore the graph G is bipartite, and denoted by G( V1 , V2 ; E).
For any two partition of the bipartite graph, it is convenient to take the smaller set as vertex set V1 ,
i.e. |V1 | ≤ |𝑉2 |.
Complete bipartite graph: A bipartite graph G( V1 , V2 ; E) is called a complete bipartite, if there is an edge
between every vertex in V1 and every vertex in V2 ,
and denoted by 𝐾𝑚,𝑛 , where |V1 | = 𝑚 and |𝑉2 | = 𝑛 with 𝑚 ≤ 𝑛 .

Examples: 𝐾1,1 : 𝐾1,2 :

𝐾2,2: 𝐾2,3:

𝑎 𝑐
𝑒
Consider the graph 𝐺.
𝑓
𝑏 𝑑 𝑔

To check the graph is bipartite or not, start with the vertex 𝑎.

Let 𝑎 ∈ 𝑉1, there are three edges with one end vertex is 𝑎, therefore if graph is bipartite another end
vertices of these three edges 𝑏, 𝑐 and 𝑑 must be in 𝑉2. But there is an edge between 𝑏 and 𝑑. Therefore given
graph is not bipartite.

DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.


3
GRAPH THEORY (BCS405B) 2024

Review questions:

1. Give an example of a bipartite graph containing more than one partition.

2. Is a graph with no edge and more than one vertex is bipartite? Give reason.

3. How many edges are there in 𝐾𝑚,𝑛 ?


𝑎
4. Is the given graph is bipartite?

𝑏 𝑐

DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.


4
GRAPH THEORY (BCS405B) 2024

Lecture 3: Incidence and Adjacency, degree of a vertex, isolated vertex, pendent vertex:

Incidence: When a vertex 𝑣 is an end vertex of an edge 𝑒, then 𝑣 and 𝑒 are said to be incident with each other.
The edge 𝑒 is incident on a vertex 𝑣, or the vertex 𝑣 is incident on an edge 𝑒.

Adjacency: Two nonparallel edges are said to be adjacent if they are incident on a common vertex.
Similarly, two vertices are said to be adjacent if there is an edge between them.

Degree of a vertex: Number of edges incident on a vertex 𝑣 (self-loop counted twice) is called degree of 𝑣
Or valency of 𝑣 and denoted by 𝑑(𝑣).

Consider the graph 𝐺: fig1.1


𝑣1 𝑒1 𝑣2
𝑒8

·
𝑒2 𝑒5
𝑒6 𝑣3
𝑒3

𝑣6
𝑒4 𝑒7
𝑣4 𝑣5

In the given graph, 𝑑(𝑣1 ) = 4, 𝑑(𝑣2 ) = 4, 𝑑(𝑣3 ) = 0, 𝑑(𝑣4 ) = 3, 𝑑(𝑣5 ) = 4, 𝑑(𝑣6 ) = 1.

⟹ ∑ dig(𝑣) = 16 = 2 × 8 = 2𝑒 , where e is the number of edges.

Isolated vertex: A vertex with degree zero. In fig1.1, 𝑣3 is isolated vertex.

Pendent vertex: A vertex with degree one. In fig1.1, 𝑣6 is pendent vertex.

Null graph: A graph containing only vertices, no edge is called null graph.

Regular graph: A graph in which all the vertices are of equal degree is called a regular graph.
If all the vertices are of degree k, then we call k-regular graph.

Example:

3-regular graph

2-regular graph

DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.


5
GRAPH THEORY (BCS405B) 2024

Series edges: If the degree of a vertex 𝑣 is 2, then the two edges incident on 𝑣 are said to be in series.

Example: In the graph below, edges 𝑒1 and 𝑒5 are in series, similarly edges 𝑒3 and 𝑒4 are in series.
𝑒2
𝑒3
𝑒6
𝑒1
𝑒4
𝑒5

Even though edges 𝑒1 and 𝑒2 are adjacent but not series edges. Because common vertex is of degree 3.

Now we can define bipartite graph using the adjacency, incidence concept.

A graph G is bipartite if the vertex set V can be partitioned in to two nonempty subsets 𝑉1 and 𝑉2 such that no
two vertices of the same vertex set are adjacent. Or every edge of the graph is incident on one vertex of 𝑉1 and
one vertex of 𝑉2.

A simple bipartite graph is complete bipartite if every vertex of 𝑉1 is adjacent to each vertex of 𝑉2.

Review questions:

1. Give an example of a 1-regular graph.

2. A graph with no edge and more than one vertex is bipartite. How many partitions are there in a null graph
containing 3 vertices?

3. If the degree of a vertex is 4, then how many edges are incident on that vertex?

4. If the degree of a vertex is 2, then the graph has series edges. Say true or false. If false give reason.

5. An edge incident on the pendent vertex is called pendent edge. Degree of another end vertex of pendent edge
is 2 or more. Say true or false.

DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.


6
GRAPH THEORY (BCS405B) 2024

Lecture 4: Problems on degree of vertices, finding the number of vertices.

1. For an undirected graph, prove that ∑ dig(𝑣) = 2𝑒 , and number of odd degree vertices is even.

Proof: Since each edge contribute 2 count to the ∑ dig(𝑣).


(One for one end vertex and another for another end vertex).

∴ ∑ dig(𝑣) = 2𝑒 .

Let 𝑉1 and 𝑉2 be the set of vertices of a graph with odd and even degrees respectively.

Then ∑ dig(𝑣) = 2𝑒 ⟹ ∑𝑣∈𝑉1 dig(𝑣) + ∑𝑣∈𝑉2 dig(𝑣) = 2𝑒.


⟹ ∑𝑣∈𝑉1 dig(𝑣) + 𝑒𝑣𝑒𝑛 = 𝑒𝑣𝑒𝑛 ⟹ ∑𝑣∈𝑉1 dig(𝑣) = 𝑒𝑣𝑒𝑛 .
Sum of the odd numbers is even ⟹ number of odd numbers is even.
Therefore the number of odd degree vertices is even.
2. If 𝐺 be an undirected graph with 𝑛 vertices and 𝑒 edges, let 𝛿 = min𝑣∈𝑉 {deg(𝑣)} and ∆= max𝑣∈𝑉 {deg(𝑣)},
2𝑒
then prove that 𝛿 ≤ 𝑛 ≤ ∆ .

Solution: For any vertex 𝑣𝑖 , 𝛿 ≤ deg(𝑣𝑖 ) ≤ ∆.

Taking summation, we get ∑𝑛𝑖=1 𝛿 ≤ ∑𝑛𝑖=1 𝑑(𝑣𝑖 ) ≤ ∑𝑛𝑖=1 ∆


2𝑒
⟹ 𝑛𝛿 ≤ 2𝑒 ≤ 𝑛∆. ⟹ 𝛿≤ ≤∆.
𝑛

3. Determine |𝑉| if

i) 𝐺 has 10 edges with 2 vertices of degree 4, and all others of degree 3.

ii) 𝐺 is 3-regular graph with 9 edges .


Solution: i) Let |𝑉| = 𝑛 . Given 𝑒 = 10, 2 vertices of degree 4, and (𝑛 − 2) vertices of degree 3.
∑ dig(𝑣) = 2𝑒 ⟹ 8 + 3(𝑛 − 2) = 20 ⟹ 3(𝑛 − 2) = 12 ⟹ 𝑛 = 6.
ii) Since each vertex is of degree3, ∑ dig(𝑣) = 2𝑒 ⟹ 3𝑛 = 18 ⟹ 𝑛 = 6 .

4. There is no simple graph with degree sequence 1, 1, 1, 2, 3, 4, 5. Give reason.


Reason: Since there are 5 vertices of odd degree, there is no graph with odd number of odd degree.
5. There is no simple connected graph with eight vertices having degree sequence 1, 1, 1, 2, 3, 4, 5 and 7. Why?
Reason: Since the graph is simple and one vertex is of degree 7, the degree 7 vertex is adjacent to all the
remaining 7 vertices. Degree 5 vertex is adjacent to 4 vertices other than the vertex with degree 7. Then only
two vertices left with degree 1. Therefore degree 1 vertices is less than or equal to 2.
6. Give an example of connected graph with eight vertices having degree sequence 1, 1, 1, 2, 3, 4, 5 and 7.

DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.


7
GRAPH THEORY (BCS405B) 2024

7. Let G be a loop-free connected undirected graph containing more than one vertex. Prove that G contains at
least two vertices of same degree.

Proof: Let n be the number of vertices of G. Then a vertex v can be adjacent to at most n-1 vertices of G and at
least one vertex. Therefore 1 ≤ deg(𝑣) ≤ 𝑛 − 1. Let degrees {1, 2, 3, … . . 𝑛 − 1 } be 𝑛 − 1 pigeonholes and 𝑛
vertices be 𝑛 pigeons. Then by pigeonhole principle at least one pigeonhole contains more than one pigeons.
That is at least two vertices are of same degrees.

Review questions:

1. Is there a 3-regular graph with 5 vertices? Give reason.

2. How many odd degree vertices are there in 𝐾3,4 ?

3. How many even degree vertices are there in 𝐾5,8 ?

4. k-regular graph contains 15 edges and 6 vertices, then, 𝑘 =?

5. How many edges are there in 1-regular graph containing 10 vertices?

DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.


8
GRAPH THEORY (BCS405B) 2024

Lecture 5: (Tutorial) Application of graph.


𝐊𝐨𝐧𝐢𝐠𝐬𝐛𝐞𝐫𝐠‐ 𝐛𝐫𝐢𝐝𝐠𝐞 𝐩𝐫𝐨𝐛𝐥𝐞𝐦: In Konigsberg two islands C and D, two land arias A and B are connected by
seven bridges as shown in the figure.
A

C D

Problem is whether a person can start from any land area A, B, C or D walk through all the seven bridges
exactly once and then return to the starting point. Euler represented the four land areas as vertices and the
bridges as edges of a graph. Euler proved that a solution for this problem does not exist.
A

C D

Utilities Problem: There are three houses 𝐻1 , 𝐻2 and 𝐻3 , each to be connected to each of the three utilities-
water(W), gas(G) and electricity(E) by means of pipes. Is it possible to make such connections without
crossovers of the pipes?

This problems can be represented by a graph by taking houses and utility supply centers are vertices and pipe
connections as edges.

𝐻1 𝐻2 𝐻3

𝑊 𝐺 𝐸

DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.


9
GRAPH THEORY (BCS405B) 2024

If 𝑛 = 𝑛1 + 𝑛2 + 𝑛3 + ⋯ ⋯ + 𝑛𝑘 with each 𝑛𝑖 ≥ 1 , then prove that ∑𝑘𝑖=1 𝑛𝑖2 ≤ 𝑛2 − (𝑘 − 1)(2𝑛 − 𝑘)

Proof: Clearly ∑𝑘𝑖=1(𝑛𝑖 − 1) = 𝑛 − 𝑘

Squaring both sides,


2
[∑𝑘𝑖=1(𝑛𝑖 − 1)] = 𝑛2 + 𝑘 2 − 2𝑛𝑘

∑𝑘𝑖=1(𝑛𝑖2 − 2𝑛𝑖 ) + 𝑘 + Nonnegative cross terms = 𝑛2 + 𝑘 2 − 2𝑛𝑘

Because (𝑛𝑖 − 1) ≥ 0 for all 𝑖

Hence, ∑𝑘𝑖=1 𝑛𝑖2 − 2𝑛 + 𝑘 ≤ 𝑛2 + 𝑘 2 − 2𝑛𝑘

⟹ ∑𝑘𝑖=1 𝑛𝑖2 ≤ 𝑛2 + 𝑘 2 − 𝑘 + 2𝑛 − 2𝑛𝑘

Or, ∑𝑘𝑖=1 𝑛𝑖2 ≤ 𝑛2 − (𝑘 − 1)(2𝑛 − 𝑘)

Review questions:

1. Draw the graph representing problems of two houses and three utilities.

2. Draw the graph of following chemical compounds by representing atoms by vertices and chemical bonds
between them by edges.

i) 𝐶𝐻4 ii) 𝐶2 𝐻6 iii) 𝐶6 𝐻6 iv) 𝑁2 𝑂3

DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.


10
GRAPH THEORY (BCS405B) 2024

Lecture 6: Isomorphic Graphs

Isomorphic Graphs:
Let G1 ( V1 , E1 ) and G2 (V2 , E2 ) be two undirected graphs. If there exists a function 𝑓 from V1 to V2 such that
i) 𝑓 is bijective. (One-one and onto).
ii) {𝑎, 𝑏} ∈ E1 ⟺ {𝑓(𝑎), 𝑓(𝑏)} ∈ E2 , for all 𝑎, 𝑏 ∈ V1 .
Then G1 and G2 are isomorphic graphs denoted by G1 ≅ G2 .
Or simply, Two graphs G1 ( V1 , E1 ) and G2 (V2 , E2 ) are said to be isomorphic if there is a one to one
correspondence between their vertices and between their edges such that the incidence relationship is preserved.
Example: Show that the following two graphs are isomorphic.
a v

u x

f b and

e c w

d y z
Solution: Consider the function 𝐹 from V1 to V2 such that 𝐹(a) = u, 𝐹(c) = v, 𝐹(e) = x,
𝐹(d) = y, 𝐹(b) = z , 𝐹(f) = w .
Clearly F is one to one and onto function.

{a, c} ∈ E1 ⟺ {𝐹(a), 𝐹(c)} = {u, v} ∈ E2 . {b, f} ∈ E1 ⟺ {𝐹(b), 𝐹(f)} = {z, w} ∈ E2 .

{a, e} ∈ E1 ⟺ {𝐹(a), 𝐹(e)} = {u, x} ∈ E2 . {b, e} ∈ E1 ⟺ {𝐹(b), 𝐹(e)} = {z, x} ∈ E2 .

{a, d} ∈ E1 ⟺ {𝐹(a), 𝐹(d)} = {u, y} ∈ E2 . {b, d} ∈ E1 ⟺ {𝐹(b), 𝐹(d)} = {z, y} ∈ E2 .

{c, f} ∈ E1 ⟺ {𝐹(c), 𝐹(f)} = {v, w} ∈ E2 . {c, e} ∈ E1 ⟺ {𝐹(c), 𝐹(e)} = {v, x} ∈ E2 .

{d, f} ∈ E1 ⟺ {𝐹(d), 𝐹(f)} = {y, w} ∈ E2 .


Therefore given two graphs are isomorphic.

2. Show that following two graphs are isomorphic.

𝑎 𝑒1 𝑣5
𝑒 𝑣4
𝑒3 𝑣3
4 2
5 1
𝑒2
𝑒4 𝑒6
𝑐
3
6

𝑑 𝑒5 𝑣2
𝑣1
𝑏

DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.


11
GRAPH THEORY (BCS405B) 2024

Solution: In both the graph there is only one pendent vertex, and one vertex with degree two, the function
𝑓 from V1 to V2 such that 𝑓(𝑏) = 𝑣2 , 𝑓(𝑒) = 𝑣5 . In first graph pendent vertex is adjacent to the vertex 𝑑,
therefore 𝑓(𝑑) = 𝑣4 . The remaining two vertices 𝑎, 𝑐 are adjacent to the vertices 𝑏, 𝑑 . Similarly vertices 𝑣1 , 𝑣3
are adjacent to the vertices 𝑣2 , 𝑣4 . ∴ 𝑓(𝑎) = 𝑣1 and 𝑓(𝑐) = 𝑣3 Or 𝑓(𝑎) = 𝑣3 and 𝑓(𝑐) = 𝑣1 .
Let 𝑓 be a function from V1 to V2 such that 𝑓(𝑎) = 𝑣1 , 𝑓(𝑏) = 𝑣2 , 𝑓(𝑐) = 𝑣3 , 𝑓(𝑑) = 𝑣4 and 𝑓(𝑒) = 𝑣5 .
Clearly 𝑓 is one-one and onto. The edges 1, 2, 3, 4, 5, 6 corresponds to 𝑒1 , 𝑒2 , 𝑒3 , 𝑒4 , 𝑒5 , 𝑒6 respectively.
Therefore given two graphs are isomorphic.

Necessary conditions (but not sufficient) for two graphs to be isomorphic:


If two graphs are isomorphic, then
i) They have the same number of vertices.
ii) The same number of edges.
iii) An equal number of vertices with given degree. (Same degree sequence).

Consider the following two graphs: Both the graphs are having 6 vertices, 5 edges, one vertex of degree 3, two
vertices of degree 2, and 3 pendent vertices.

But in the first graph, two pendent vertices are adjacent to the vertex with degree 3 and in the second graph,
only one pendent vertex is adjacent to the degree 3 vertex. Hence there is no isomorphic function preserving
incidence relationship.

Review questions:

1. If two graphs are isomorphic then there is unique isomorphic function. True or false?

2. Whether any bijective function between the vertices of two isomorphic graphs if isomorphic function?

3. Give reason why the following two graphs are not isomorphic?

i) and

ii)

and

DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.


12
GRAPH THEORY (BCS405B) 2024

Lecture 7: Sub-graph, walk, path, circuit:

Subgraph: If 𝐺(𝑉, 𝐸) is a graph, then 𝐺1 ( 𝑉1 , 𝐸1 ) is called subgraph of 𝐺 if ∅ ≠ 𝑉1 ⊆ 𝑉 and 𝐸1 ⊆ 𝐸, where


each edge in 𝐸1 is incident with vertices in 𝑉1.

Clearly every graph is its own subgraph. Subgraph of a subgraph of G is subgraph of G.

Spanning Subgraph: If 𝑉1 = 𝑉 , then 𝐺1 is called spanning subgraph of 𝐺 .


Or, Subgraph containing all the vertices of 𝐺 is called spanning subgraph of 𝐺.

Induced subgraph: Let 𝐺(𝑉, 𝐸) be a graph and 𝑈 is any nonempty subset of 𝑉 . The subgraph of 𝐺
induced by 𝑈 is the subgraph whose vertex set is U and contains all the edges of G which
are incident with the vertices of U and denoted by < 𝑈 >.

𝑏 𝑐 𝑑 𝑒

𝑎 𝑎

Some Subgraphs:

𝑏 𝑑 𝑐 𝑑 𝑒

𝑎 𝑎

Some Spanning Subgraphs:

𝑏 𝑐 𝑑 𝑒 𝑏 𝑐 𝑑 𝑒

𝑎 𝑎

Some induced subgraph: < {𝑎, 𝑏, 𝑐} > < {𝑎, 𝑐, 𝑑, 𝑒} >


𝑏 𝑐
𝑐 𝑑 𝑒

Walk: Let 𝑥 , 𝑦 be (not necessarily distinct) vertices of a graph 𝐺( 𝑉, 𝐸 ). 𝑥‐𝑦 walk in G is a finite alternating
sequence 𝑥 = 𝑥0 , 𝑒1 , 𝑥1 , 𝑒2 , 𝑥2 , 𝑒3 ⋯ ⋯ , 𝑒𝑛−1 𝑥𝑛−1 , 𝑒𝑛 𝑥𝑛 = 𝑦 of vertices and edges from G starting at
vertex 𝑥 and ending at 𝑦 and involving 𝑛 distinct edges with 𝑒𝑖 = {𝑥𝑖−1 , 𝑥𝑖 } , where 1 ≤ 𝑖 ≤ 𝑛.
Number of edges present in the walk is called length of the walk.
If 𝑥 = 𝑦 , then 𝑥‐𝑦 walk is called closed walk. If 𝑥 ≠ 𝑦 , then 𝑥‐𝑦 walk is called open walk.

Path: If no vertex in 𝑥‐𝑦 open walk appears more than once then, the 𝑥‐𝑦 walk is called path.

DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.


13
GRAPH THEORY (BCS405B) 2024

Circuit: If no vertices in a closed walk appears more than once then the closed walk is called circuit.

Examples: 𝑎 𝑏
3

4 11 10
𝑑
1 2 5 12 𝑐
9
6 8
7 𝑓
𝑒
Some 𝑎-𝑐 walk: 1𝑒2𝑎3𝑏12𝑓7𝑒6𝑑9𝑐 , 𝑎5𝑓12𝑏3𝑎411𝑏10𝑐 , 𝑐8𝑓5𝑎, 𝑎3𝑏10𝑐.
Some closed walk: 𝑎1𝑒7𝑓12𝑏11𝑑6𝑒2𝑎, 𝑑11𝑏10𝑐8𝑓7𝑒6𝑑, 𝑒2𝑎5𝑓8𝑐9𝑑4𝑎3𝑏12𝑓7𝑒.
Some 𝑎-𝑐 path: 𝑎1𝑒6𝑑9𝑐, 𝑎1𝑒7𝑓12𝑏11𝑑9𝑐, 𝑎4𝑑9𝑐, 𝑎2𝑒7𝑓8𝑐.
Some circuits: 𝑎1𝑒2𝑎, 𝑎1𝑒7𝑓8𝑐10𝑏3𝑎, 𝑎5𝑓12𝑏3𝑎.
Every circuit is a closed walk. Every path is a walk.
Theorem: Prove that a circuit graph, 𝐶𝑛 on 𝑛 vertices is bipartite if and only if 𝑛 is even.
Solution: Let 𝑣1 − 𝑣2 ‑𝑣3 ⋯ 𝑣𝑛 − 𝑣1 be a circuit graph 𝐶𝑛 on 𝑛 vertices. If 𝐶𝑛 is bipartite, then there exists a
partition of vertex set 𝑉 in to two subsets 𝑉1 and 𝑉2 such that there is no edge in 𝐶𝑛 between the vertices of V1
or between the vertices of V2 . Therefore, all the odd suffix vertices are in one vertex set and even suffix vertices
are in another vertex set. If n is odd then 𝑣𝑛 belongs to the same vertex set that contains 𝑣1 . Which is impossible
because 𝑣1 and 𝑣𝑛 are adjacent. Hence, 𝑛 is even.
Conversely, suppose 𝐶𝑛 : 𝑣1 ‑𝑣2 ‑𝑣3 ⋯ 𝑣𝑛 ‑𝑣1 be a circuit graph with n is even.
Clearly the set 𝑉1 = {𝑣1 , 𝑣3 , ⋯ 𝑣𝑛−1 } and 𝑉2 = {𝑣2 , 𝑣4 , ⋯ 𝑣𝑛 } form a partition of vertex set V such that each
edge in 𝐶𝑛 joins a vertex in V1 and a vertex in V2 . Therefore, 𝐶𝑛 is bipartite.
Prove that a connected Graph G is bipartite if and only if G contains no circuit of odd length.
Review questions: 1. Find the i) number of spanning subgraphs, ii) number of connected spanning subgraphs .
iii) Number of spanning subgraphs with 𝑎 as isolated vertex. iv) Induced subgraph 〈{𝑎, 𝑏, 𝑐, 𝑑}〉.
a

g e

h i
2. A null graph containing 3 vertices, how many subgraphs are there? How many spanning subgraphs are there?
3. Is every 𝑥-𝑦 walk is a 𝑥-𝑦 path?
4. Is every 𝑥-𝑥 closed walk is a 𝑥-𝑥 circuit?
5. Is the graph is spanning subgraph of itself?

DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.


14
GRAPH THEORY (BCS405B) 2024

Lecture 8: Connected graph, Complete Graph.


Connected graph: A graph is said to be connected, if there is at least one path between every pair of vertices of
a graph. A graph is not connected is called disconnected graph.
If a graph G (V, E) is disconnected, then the vertex set V can be partitioned into at least two subsetsV1 & V2 such
that there is no edge in E of the form {𝑥, 𝑦} where 𝑥 ∈ V1 and 𝑦 ∈ V2 .
Or, any vertex V1 is not adjacent each vertex of V2 .

Component: Maximal connected sub graph of a graph is called component.


For any graph G = ( V, E ) , number of components of G is denoted by 𝜅(𝐺).

Therefore if, 𝜅(𝐺 ) = 1, then graph is connected, and if 𝜅(𝐺 ) ≥ 2, then graph is disconnected.

Complete Graph (𝑲𝒏 ): Complete graph on n vertices is simple graph with one and only one edge between
every pair of vertices.

Examples: 𝑲𝟏 : 𝑲𝟐 : 𝑲𝟑 : 𝑲𝟒 :

Complement of a graph: Let 𝐺 be a simple graph on 𝑛 vertices. The complement of 𝐺 denoted by 𝐆 is the
subgraph of 𝐾𝑛 consisting of the 𝑛 vertices of 𝐺 and all edges of 𝐾𝑛 that are not in G.

Examples: 𝑮 : 𝐆∶

1. Find the number of edges in 𝐾𝑛 and 𝐾𝑚,𝑛 .

𝐾𝑛 is a complete graph and hence there is one and only one edge between any two vertices.
𝑛(𝑛−1)
Therefore, number of edges is number of selections of 2 vertices from n vertices ∴ 𝑒 = 𝑛𝑐2 = .
2

𝑛(𝑛−1)
Or, in 𝐾𝑛 every vertex is of degree (𝑛 − 1) .Therefore 2𝑒 = ∑ dig(𝑣) = 𝑛(𝑛 − 1) ∴ 𝑒 = .
2

In 𝐾𝑚,𝑛 , from each of m vertices of one vertex set there are n edges to the n vertices of another vertex set.
Therefore, number of edges in 𝐾𝑚,𝑛 is 𝑒 = 𝑚𝑛. and the number of vertices is 𝑚 + 𝑛.

2. Prove that a graph G is disconnected if and only if its vertex set V is partitioned into two nonempty subsets
𝑉1 and 𝑉2 such that there is no edge in G with one end vertex is in 𝑉1 and another end vertex is in 𝑉2 .
Proof: If such partition exists, then there is no path between the any vertex of 𝑉1 and each vertex of 𝑉2.
Hence, graph is disconnected.
Suppose the graph G is disconnected, then the graph contains at least two components. Take the set of
vertices of one component as the vertex set 𝑉1 and the set of remaining vertices as vertex set 𝑉2 .
Then there is no edge in G with one end vertex is in 𝑉1 and another end vertex is in 𝑉2 .

DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.


15
GRAPH THEORY (BCS405B) 2024

3. If G is a graph on n vertices, for 𝑛 ≥ 2, and G is not connected, prove that 𝐺̅ is connected.

Proof: If G = (V, E) is not connected, then the vertex set V can be partitioned into at least two subsets V1, V2
such that there is no edge in E of the form {x, y} where x ∈ V1 and y ∈ V2. But the edge {x, y} is in 𝐺̅ for any
vertices x ∈ V1 and y ∈ V2.
To show 𝐺̅ is connected. Consider any two vertices 𝑎, 𝑏 of 𝐺̅ . If 𝑎 ∈ 𝑉1 and 𝑏 ∈ 𝑉2 or 𝑎 ∈ 𝑉2 and 𝑏 ∈ 𝑉1
then the edge {𝑎, 𝑏} is in 𝐺̅ , and hence there is a path in 𝐺̅ between 𝑎 and 𝑏.
If 𝑎 and 𝑏 both are in 𝑉1 (or in 𝑉2). Then {𝑎, 𝑐}, {𝑐, 𝑏} is 𝑎-𝑏 path in 𝐺̅ , where 𝑐 ∈ 𝑉2 (or 𝑐 ∈ 𝑉1).
Therefore 𝐺̅ is connected.

4. Define self-complimentary graph, give an example of 4 vertices and 5 vertices self-complimentary graph.

Solution: A simple graph 𝐺 is said to be self-complimentary graph, if and only if ≅ 𝐺 .

5. Find the number of paths of length 2 in the graph

Solution: If the two edges are selected from all the edges incident on a vertex, we get a path of length 2.
There is one vertex of degree 4, four vertices of degree 3 and one vertex of degree 2.
Therefore, number of paths of length 2 = 4𝐶2 + 4 × 3𝐶2 + 2𝐶2 = 19.

6. Prove that if 𝐺 is self-complimentary then the number of vertices in 𝐺 is either 4𝑘 or 4𝑘 + 1


for some integer 𝑘.
Proof: If 𝐺 is self-complimentary, then ≅ 𝐺 . Hence, number of edges in 𝐺 = number of edges in 𝐺 = 𝑒.

But, number of edges in 𝐺 + number of edges in 𝐺 =number of edges in 𝐾𝑛 .


𝑛(𝑛−1) 𝑛(𝑛−1)
⟹ 𝑒+𝑒 = ⟹𝑒= ⟹ 4|𝑛 or 4|𝑛 − 1
2 4
⟹ 𝑛 = 4𝑘 or 𝑛 − 1 = 4𝑘 ⟹ 𝑛 = 4𝑘 or 4𝑘 + 1 for some integer 𝑘.

DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.


16
GRAPH THEORY (BCS405B) 2024

7. If a graph (connected or disconnected) has exactly two vertices of odd degree, there must be a path joining
these two vertices.
Proof: Since the graph has only two vertices of odd degree, and number of odd degree vertices is always even,
both the odd degree vertices must be in one component of the graph. Each component is connected, and hence
there is at least one path between the two odd degree vertices.

(𝑛−𝑘)(𝑛−𝑘+1)
8. Prove that a simple graph with 𝑛 vertices and 𝑘 components can have at the most edges.
2
Proof: Let the number of vertices in each of the k components of a simple graph be 𝑛1 , 𝑛2 , 𝑛3 , ⋯ , 𝑛𝑘 .
Thus, 𝑛 = 𝑛1 + 𝑛2 + 𝑛3 + ⋯ ⋯ + 𝑛𝑘 with each 𝑛𝑖 ≥ 1 .
𝑛𝑖 (𝑛𝑖 −1)
The maximum number of edges in 𝑖th component is .
2
Therefore maximum number of edges in the graph is

1 1 𝑛 By the inequality
∑𝑘𝑖=1(𝑛𝑖2 − 𝑛𝑖 ) = ∑𝑘𝑖=1 𝑛𝑖2 −
2 2 2
1
≤ 2 [𝑛2 − (𝑘 − 1)(2𝑛 − 𝑘) − 𝑛] ∑𝑘𝑖=1 𝑛𝑖2 ≤ 𝑛2 − (𝑘 − 1)(2𝑛 − 𝑘)
1
= 2 [𝑛2 + 𝑛 − 2𝑛𝑘 + 𝑘 2 − 𝑘]
1
= 2 [(𝑛 − 𝑘) + (𝑛 − 𝑘)2 ]
(𝑛−𝑘)(𝑛−𝑘+1)
= 2
Therefore if graph is disconnected then it has at least two component, and hence maximum number of edges in
(𝑛−2)(𝑛−1) (𝑛−2)(𝑛−1)
the disconnected simple graph is . Therefore if a simple graph contains more than edges
2 2
then graph is connected

Review questions:
1. What is the compliment of 𝐾𝑛 ?
2. What is the compliment of null graph?
3. Whether the compliment of multigraph exists?
4. For what value of 𝑛, a complete graph is also bipartite graph?
5. Can a disconnected graph be a bipartite graph?

DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.


17
GRAPH THEORY (BCS405B) 2024

Lecture 9: (Tutorial) Application of graphs: Electrical network problems, seating problems.

Electrical Network Problems: Properties (such as transfer function and input impedance) of an electrical
network are functions of only two factors:
1. The nature and value of the elements forming the network, such as resistors, inductors, transistors, and
so forth.
2. The way these elements are connected together, that is, the topology of the network.
Since there are only a few different types of electrical elements, the variations in networks are chiefly due to the
variations in topology. Thus, electrical network analysis and synthesis are mainly the study of network
topology. In the topological study of electrical networks, factor 2 is separated from 1 and is studied
independently.
The topology of a network is studied by means of its graph. In drawing a graph of an electrical network the
junctions are represented by vertices, and branches (which consist of electrical elements) are represented by
edges, regardless of the nature and size of the electrical elements.

Example: 𝑏 𝑏

𝑎 𝑐 𝑎 𝑐
𝑒 𝑒

𝑑
𝑑
Electrical network. Graph of electrical network.

Seating Problem: Nine members of a new club meet each day for lunch at a round table. They decide to sit
such that every member has different neighbors at each lunch. How many days can this arrangement last? This
situation can be represented by a graph with nine vertices such that each vertex represents a member, and an
edge joining two vertices represents the relationship of sitting next to each other. Then each arrangement is a
circuit containing all the vertices. Hence the solution to the seating problem is to find the number of edge
disjoint circuits containing all the vertices in a complete graph 𝐾9 .

A PUZZLE WITH MULTICOLORED CUBES: We are given four cubes. The six faces of every cube are
variously colored blue, green, red, or white. Is it possible to stack the cubes one on top of another to form a
column such that no color appears twice on any of the four sides of this column?

Problem can be solved by using graphs. Two steps are involved here: First, the physical problem is converted
into a problem of graph theory. Second, the graph-theory problem is then solved.

Interested students can solve this problem. Cubes are available in the department.

DEPARTMENT OF CUMPUTER SCIENCE & ENGINEERING /C.E.C.


18

You might also like