8 Graph Theory Fundamentals

Discrete Structure ยท Unit 8

Graph Theory Fundamentals

Exam-focused notes for Graph Theory Fundamentals (Discrete Structure, BIT152): what the TU syllabus asks and how it has actually been tested, with 8 solved past questions from this unit.

Graph Theory Fundamentals in short

Graphs model networks of connected things: roads, computer networks, friendships and web links. This chapter defines graphs, their types and representations, and basic properties such as connectivity and planarity.

Graph Theory Fundamentals: notes

Graph definition and types

A graph $G = (V, E)$ has a non-empty set $V$ of vertices (nodes) and a set $E$ of edges, each joining two vertices. The two vertices of an edge are its endpoints, and the edge is incident to them. Two vertices joined by an edge are adjacent.

The degree of a vertex $v$, written $\deg(v)$, is the number of edges incident to it. A loop adds 2 to the degree.

Handshaking theorem: the sum of the degrees of all vertices equals twice the number of edges.

$$\sum_{v \in V} \deg(v) = 2|E|$$

So the number of vertices of odd degree is always even.

Example. A graph with edges $ab, ac, bc, cd$ has degrees $\deg(a) = 2$, $\deg(b) = 2$, $\deg(c) = 3$, $\deg(d) = 1$. The sum is $8 = 2 \cdot 4$.

Special graphs:

  • Complete graph $K_n$: every pair of vertices is joined. It has $\frac{n(n-1)}{2}$ edges. $K_4$ has 6.
  • Cycle $C_n$: $n$ vertices joined in a ring, $n$ edges.
  • Path $P_n$: $n$ vertices in a line.
  • Regular graph: all vertices have the same degree.
  • Complete bipartite $K_{m,n}$: see the bipartite section.
  • Subgraph: a graph whose vertices and edges all belong to $G$.

Simple graphs and pseudographs

TypeEdgesLoopsMultiple edges
Simple graphundirectednono
Multigraphundirectednoyes
Pseudographundirectedyesyes
Directed graphdirectedallowedno
Directed multigraphdirectedallowedyes

A loop is an edge from a vertex to itself. Multiple (parallel) edges join the same pair of vertices. A computer network with two separate cables between the same two machines is a multigraph. A network where a machine can send a message to itself is a pseudograph.

A simple graph on $n$ vertices has at most $\frac{n(n-1)}{2}$ edges.

Graph representation using adjacency matrix

The adjacency matrix $A$ of a graph with vertices $v_1, \dots, v_n$ is an $n \times n$ matrix. Entry $a_{ij}$ is the number of edges between $v_i$ and $v_j$ (1 or 0 for a simple graph).

Example. The graph with edges $ab, ac, bc, cd$, with vertices in the order $a, b, c, d$:

$$A = \begin{bmatrix} 0 & 1 & 1 & 0 \ 1 & 0 & 1 & 0 \ 1 & 1 & 0 & 1 \ 0 & 0 & 1 & 0 \end{bmatrix}$$

Observations:

  • The matrix of an undirected graph is symmetric.
  • A simple graph has zeros on the diagonal. A loop gives a non-zero diagonal entry.
  • Row sums give the degrees: $2, 2, 3, 1$.

The matrix needs $n^2$ entries, which suits dense graphs. For sparse graphs, an adjacency list uses less space.

What this unit covers

  • Graph definition and types
  • Simple graphs and pseudographs
  • Graph representation using adjacency matrix
  • Graph representation using incidence matrix
  • Directed graphs
  • Graph isomorphism
  • Connectivity in graphs
  • Bipartite graphs
  • Planar graphs

Connectivity in graphs

2082 ยท 5 marks

What do you mean by connectivity in graph? Discuss about Bipartite and Planar graph. [1+4]

Show solved answer

Connectivity in Graph, Bipartite Graph, and Planar Graph


Connectivity in Graph [1 mark]

Connectivity refers to the property of a graph that describes whether there exists a path between every pair of vertices.

  • A graph G is said to be connected if there exists at least one path between every pair of vertices.
  • If a graph is not connected, it is called a disconnected graph, and it consists of two or more connected components.

Example: In a graph G = (V, E), if for every u, v โˆˆ V there exists a path from u to v, then G is connected.


Bipartite Graph [2 marks]

Definition

A graph G = (V, E) is called a Bipartite Graph if its vertex set V can be partitioned into two disjoint non-empty sets Vโ‚ and Vโ‚‚ such that:

  • Vโ‚ โˆช Vโ‚‚ = V
  • Vโ‚ โˆฉ Vโ‚‚ = โˆ…
  • Every edge in E connects a vertex in Vโ‚ to a vertex in Vโ‚‚ (i.e., no edge exists between two vertices within the same set).

Key Properties

PropertyDescription
Two-colorableA graph is bipartite if and only if it can be 2-colored (no two adjacent vertices share the same color)
No odd cyclesA graph is bipartite if and only if it contains no odd-length cycles
Complete BipartiteDenoted K(m,n): every vertex in Vโ‚ is connected to every vertex in Vโ‚‚

Example

Vโ‚ = {1, 2, 3}     Vโ‚‚ = {A, B, C}

1 --- A
1 --- B
2 --- B
2 --- C
3 --- C

Here, all edges go between Vโ‚ and Vโ‚‚, so this is a bipartite graph.

Complete Bipartite Graph K(2,3)

  1       2
  |\ \  / |
  |  \/   |
  |  /\   |
  | /  \  |
  A    B   C
  • K(m,n) has m ร— n edges.
  • K(3,3) is a well-known non-planar graph.

Planar Graph [2 marks]

Definition

A graph G is called a Planar Graph if it can be drawn in a plane (2D surface) such that no two edges cross each other (except at their endpoints/vertices).

Such a drawing is called a planar embedding or planar representation.

Key Properties

1. Euler's Formula for Planar Graphs:

For a connected planar graph:

$$V - E + F = 2$$

Where:

  • V = number of vertices
  • E = number of edges
  • F = number of faces (regions, including the outer/unbounded face)

2. Edge Bound:

For a simple connected planar graph with V โ‰ฅ 3:

$$E \leq 3V - 6$$

For bipartite planar graphs:

$$E \leq 2V - 4$$

3. Kuratowski's Theorem:

A graph is non-planar if and only if it contains a subgraph that is a subdivision of either:

  • Kโ‚… (complete graph on 5 vertices), or
  • Kโ‚ƒ,โ‚ƒ (complete bipartite graph)

Example

Planar Graph:           Non-Planar Graph:
    1                       Kโ‚…
   /|\
  / | \
 2--+--3       (Can be redrawn without crossings)
  \ | /
   \|/
    4

Faces in a Planar Graph

Consider a planar graph with V = 4, E = 6 (Kโ‚„):

$$F = 2 - V + E = 2 - 4 + 6 = 4 \text{ faces}$$

Summary Table

Graph TypeKey ConditionExample
BipartiteVertices split into 2 sets; edges only between setsK(2,3), K(3,3)
PlanarCan be drawn without edge crossingsKโ‚„, Trees
Non-PlanarContains Kโ‚… or Kโ‚ƒ,โ‚ƒ as subdivisionKโ‚…, Kโ‚ƒ,โ‚ƒ

Note: Kโ‚ƒ,โ‚ƒ is bipartite but non-planar, showing that bipartite and planar are independent properties.

Open this answer on its own page โ†’

2080 ยท 10 marks

What does connectivity in graphs mean? Differentiate between permutation and combination. Solve the recurrence relation $a_n = 7a_{n-1} - 10a_{n-2}$ with initial conditions $a_0 = 2$ and $a_1 = 3$. [4+6]

  • Recurrence: $an = 7a{n-1} - 10a{n-2}$ - Initial conditions: $a0 = 2$, $a1 = 3$ - Conceptual parts: connectivity in graphs; permutation vs combination. --- Connectivity describes the extent to which vertices of a graph are reachable from one another through paths (sequences of edges). - Connecte...
Open this answer on its own page โ†’

Graph isomorphism

2081 ยท 10 marks

Define graph isomorphism with an example.Using Kruskal's algorithm generate the Minimum Spanning Tree from following graph.[5+5]

Show solved answer

Graph Isomorphism and Minimum Spanning Tree (Kruskal's Algorithm)


Given

Part 1: Define graph isomorphism with an example. [5 marks]

Part 2: Generate the MST using Kruskal's algorithm "from following graph." [5 marks]

Missing data: The actual graph (vertices, edges, and edge weights) referenced by "following graph" is not provided in the text. No image, adjacency list, or weight matrix was included. Therefore the exact numeric MST for the intended graph cannot be computed.

I will fully answer Part 1 (self-contained) and, for Part 2, present the correct Kruskal procedure applied to a clearly labelled representative graph, explicitly flagged as illustrative since the real graph is unreadable/absent.


Solution

(a) Graph Isomorphism

Definition

Two graphs $G_1 = (V_1, E_1)$ and $G_2 = (V_2, E_2)$ are isomorphic if there exists a bijection (one-to-one and onto mapping)

$$f : V_1 \rightarrow V_2$$

such that for all vertices $u, v \in V_1$:

$$(u, v) \in E_1 \iff (f(u), f(v)) \in E_2$$

Informally, two graphs are isomorphic if one can be obtained from the other by relabelling the vertices, preserving the adjacency structure. We write $G_1 \cong G_2$.

Necessary Conditions

ConditionRequirement
Same vertex count$
Same edge count$
Same degree sequenceSorted degrees identical
Same number of componentsStructure preserved

These are necessary but not sufficient.

Example

Graph $G_1$: $V_1 = {1,2,3,4}$, $E_1 = {(1,2),(2,3),(3,4),(4,1)}$

Graph $G_2$: $V_2 = {a,b,c,d}$, $E_2 = {(a,b),(b,d),(d,c),(c,a)}$

Both are 4-cycles with degree sequence ${2,2,2,2}$.

Bijection: $f(1)=a,\ f(2)=b,\ f(3)=d,\ f(4)=c$

Verification:

  • $(1,2) \to (a,b)$ โœ“
  • $(2,3) \to (b,d)$ โœ“
  • $(3,4) \to (d,c)$ โœ“
  • $(4,1) \to (c,a)$ โœ“

All edges map to edges, so $G_1 \cong G_2$.


(b) MST using Kruskal's Algorithm

Note: The specific graph in the question was not available in the provided text. The following uses a clearly labelled representative graph to demonstrate the method. Substitute the actual edge weights if the graph is available.

Algorithm

  1. Sort all edges in non-decreasing order of weight.
  2. Pick the smallest edge; add it to the MST if it does not create a cycle (use union-find).
  3. Repeat until the MST contains $V - 1$ edges.

Illustrative Graph

Vertices ${A,B,C,D,E,F}$ with edges:

EdgeWtEdgeWtEdgeWt
A-B4B-F5D-E2
A-F2B-C6E-F9
C-D3C-F8B-E7

Sorted Edges

$$A\text{-}F(2),\ D\text{-}E(2),\ C\text{-}D(3),\ A\text{-}B(4),\ B\text{-}F(5),\ B\text{-}C(6),\ B\text{-}E(7),\ C\text{-}F(8),\ E\text{-}F(9)$$

Selection

StepEdgeWtCycle?ActionComponents
1A-F2NoAdd{A,F},{B},{C},{D},{E}
2D-E2NoAdd{A,F},{B},{C},{D,E}
3C-D3NoAdd{A,F},{B},{C,D,E}
4A-B4NoAdd{A,B,F},{C,D,E}
5B-F5YesSkip-
6B-C6NoAdd{A,B,C,D,E,F}

Now MST has $V-1 = 5$ edges. Stop.

Result

MST edges: A-F, D-E, C-D, A-B, B-C

$$\text{Total weight} = 2 + 2 + 3 + 4 + 6 = 17$$

        A ---4--- B ---6--- C ---3--- D ---2--- E
        |
        2
        |
        F

Minimum Spanning Tree total cost = 17 (for the illustrative graph).


For the illustrative graph used here the minimum spanning tree total is 17. The genuine limitation is that the actual exam graph was not provided, so repeat the same selection steps on the graph printed on your paper.

Open this answer on its own page โ†’

2080.1 ยท 10 marks

Differentiate between graph and tree.Describe about the necessary conditions for graphs to be isomorphic with an example.[2+8]

--- (a) Difference Between Graph and Tree Graph Tree --------------------- A graph is a collection of vertices (nodes) and edges with no restrictions on cycles. A tree is a connected, acyclic (no cycles) undirected graph. A graph may or may not be connected. A tree is always connected. A graph wi...

Open this answer on its own page โ†’

Graph representation using adjacency matrix

2081 ยท 5 marks

Explain any two ways of representing the graph. [5]

An adjacency matrix is a 2D array (matrix) of size V x V, where V is the number of vertices in the graph. Definition: For a graph G = (V, E), the adjacency matrix A is defined as: Example: Consider a graph with 4 vertices (1, 2, 3, 4) and edges: (1,2), (1,3), (2,4), (3,4) Advantages: - Simple to ...

Open this answer on its own page โ†’

0 ยท 5 marks

How can we represent a graph using Adjacency Matrix? Explain. [5]

An Adjacency Matrix is a 2D array (matrix) used to represent a graph. For a graph with n vertices, the adjacency matrix is an n ร— n matrix where each cell indicates whether a pair of vertices is connected by an edge. --- Let A be the adjacency matrix of a graph with vertices V = {vโ‚, vโ‚‚, ..., vโ‚™}...

Open this answer on its own page โ†’

Graph representation using incidence matrix

2080 ยท 5 marks

Explain incidence matrix representation of a graph with example. [5]

An incidence matrix is a 2D matrix used to represent a graph where: - Rows represent the vertices of the graph - Columns represent the edges of the graph For a graph G = (V, E) with n vertices and m edges, the incidence matrix is an n ร— m matrix B, where: $$B[i][j] = \begin{cases} 1 & \text{if ve...

Open this answer on its own page โ†’

Graph definition and types

2078 ยท 5 marks

What is graph? Explain simple graph and pseudograph with example. [5]

A graph G is a mathematical structure consisting of a non-empty set of vertices (nodes) V and a set of edges E, where each edge connects two vertices. Formally: G = (V, E) - V = {vโ‚, vโ‚‚, vโ‚ƒ, ...} โ†’ set of vertices - E = {eโ‚, eโ‚‚, eโ‚ƒ, ...} โ†’ set of edges Each edge e โˆˆ E is associated with an unorde...

Open this answer on its own page โ†’