0% found this document useful (0 votes)
3 views22 pages

Assignment Key Unit-5(Set 1 & 2)

The document contains an assignment on Discrete Mathematics covering various concepts such as planar graphs, chromatic numbers of bipartite graphs, Hamiltonian paths and circuits, spanning trees, and search algorithms like BFS and DFS. It includes both short answer and long answer questions that require comparisons and derivations related to graph theory, including isomorphic graphs and minimum spanning trees using Kruskal's algorithm. Additionally, it discusses the properties of the Petersen graph and its lack of a Hamiltonian cycle.

Uploaded by

juveriajane136
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
3 views22 pages

Assignment Key Unit-5(Set 1 & 2)

The document contains an assignment on Discrete Mathematics covering various concepts such as planar graphs, chromatic numbers of bipartite graphs, Hamiltonian paths and circuits, spanning trees, and search algorithms like BFS and DFS. It includes both short answer and long answer questions that require comparisons and derivations related to graph theory, including isomorphic graphs and minimum spanning trees using Kruskal's algorithm. Additionally, it discusses the properties of the Petersen graph and its lack of a Hamiltonian cycle.

Uploaded by

juveriajane136
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 22

DECCAN COLLEGE OF ENGINEERING &TECHNOLOGY

B.E. CSE III SEMESTER


DISCRETE MATHEMATICS
ASSIGNMENT KEY-5 (UNIT-5)
SET-1
SHORTANSWERQUESTIONS:
1) Explain the concept of a planar graph.
A planar graph is a graph that can be drawn on a plane (a flat surface) in such a way that no edges cross each other.
In other words, a graph is planar if it can be embedded in the plane, where its vertices are represented as points and its
edges as curves or straight lines, without any two edges intersecting at any point other than their endpoints.
• Example: A simple triangle (3 vertices, 3 edges) is a planar graph because it can be drawn without any edges
crossing each other.
• Non-Example: The K5 graph (complete graph on 5 vertices) is non-planar. It cannot be drawn in a plane
without edges crossing.

2) Find the chromatic number of a bipartite graph.


A bipartite graph is a graph in which the set of vertices can be divided into two disjoint sets, such that every edge
connects a vertex from one set to a vertex from the other set. No edge exists between two vertices within the same set.
The chromatic number of a graph is the minimum number of colors needed to color the graph’s vertices so that no
two adjacent vertices share the same color.
• For a bipartite graph, the chromatic number is always 2, because the two disjoint sets of vertices can each be
colored with a single color, and no two adjacent vertices will have the same color.
Conclusion: The chromatic number of any bipartite graph is 2.

3) What is a Hamiltonian path and a Hamiltonian circuit?


• Hamiltonian Path: A Hamiltonian path is a path in a graph that visits each vertex exactly once. It does not
necessarily return to the starting vertex.
• Hamiltonian Circuit (or Cycle): A Hamiltonian circuit is a special type of Hamiltonian path that starts and
ends at the same vertex, forming a cycle. It visits each vertex exactly once, except for the starting vertex,
which is revisited at the end.
• Example:
o Hamiltonian Path: In a graph with vertices {1, 2, 3, 4}, a Hamiltonian path could be: 1 → 2 → 4 →
3.
o Hamiltonian Circuit: In the same graph, a Hamiltonian circuit could be: 1 → 2 → 4 → 3 → 1.

4) Differentiate between a spanning tree and a subgraph.


• Spanning Tree:
o A spanning tree of a connected graph is a subgraph that includes all the vertices of the original graph,
but only enough edges to form a tree (i.e., a connected acyclic graph).
o A spanning tree contains exactly V-1 edges, where V is the number of vertices in the graph.
o Example: If a graph has 5 vertices, the spanning tree will have 4 edges.
• Subgraph:
o A subgraph is any subset of the vertices and edges of a graph. It does not necessarily need to be
connected, and it may or may not form a tree.
o A subgraph can include fewer vertices and edges than the original graph.
o Example: A subgraph of a graph with vertices {1, 2, 3, 4, 5} could consist of just vertices 1, 2, and 3
with edges between them.
Key Differences:
• A spanning tree includes all the vertices of the graph and forms a connected tree, while a subgraph can have
any number of vertices and edges, with no such restrictions.
• A spanning tree has exactly V-1 edges, whereas a subgraph can have any number of edges.

5) Differentiate between BFS (Breadth-First Search) and DFS (Depth-First Search).


• BFS (Breadth-First Search):
o BFS is an algorithm for traversing or searching a graph in a breadthward motion.
o It uses a queue to explore all the vertices at the present level before moving to the next level.
o BFS starts from a given node and explores all its neighbors at the current level before moving on to
the neighbors' neighbors (next level).
o BFS is useful for finding the shortest path in an unweighted graph.
• DFS (Depth-First Search):
o DFS is an algorithm for traversing or searching a graph in a depthward motion.
o It uses a stack (or recursion) to explore a node’s neighbors as deeply as possible before backtracking.
o DFS starts from a given node and explores one branch of the graph as deep as possible before
backtracking to explore other branches.
o DFS is useful for tasks such as topological sorting and finding strongly connected components.
Key Differences:
• BFS uses a queue and explores level by level, while DFS uses a stack and explores as deep as possible.
• BFS is better suited for finding the shortest path in an unweighted graph, while DFS is more efficient in
problems requiring exploring deep connections.
• BFS generally visits all nodes in the order of their distance from the starting node, while DFS might not do so,
depending on the structure of the graph.

LONGANSWERQUESTIONS:
6a) Compare and contrast Hamiltonian graphs and Euler circuits with examples.
Hamiltonian Graph:
• A Hamiltonian graph is a graph that contains a Hamiltonian cycle, i.e., a cycle that visits each vertex of the
graph exactly once and returns to the starting vertex.
• A Hamiltonian path visits each vertex exactly once, but it doesn't necessarily form a cycle.
• Example of a Hamiltonian graph: A simple pentagon (5 vertices) is a Hamiltonian cycle because it forms a
closed path where each vertex is visited once.
Euler Circuit:
• An Euler circuit is a cycle in a graph that visits every edge exactly once and returns to the starting vertex.
• A graph must have even degree vertices to contain an Euler circuit. If a graph has an odd degree for any
vertex, it does not have an Euler circuit.
• Example of an Euler circuit: A simple square (4 vertices) is an Euler circuit since we can start at any vertex
and trace all edges exactly once.
Key Differences:
• A Hamiltonian cycle involves visiting all vertices exactly once, while an Euler circuit involves visiting all
edges exactly once.
• A Hamiltonian graph may or may not have an Euler circuit, and vice versa.
Example:
• Hamiltonian Graph: A pentagon (5 vertices).
• Euler Circuit: A square (4 vertices).

6 b) Show that the two given graphs are isomorphic.

Step-by-step process to show the graphs are isomorphic:


1. Check the number of vertices and edges:
o Vertices: Both graphs have 6 vertices (the circles). Graph 1 has a, b, c, d, e, f and Graph 2 has a', b',
c', d', e', f'. So, the number of vertices matches.
o Edges: Both graphs have 9 edges (the lines connecting the circles). You can count them to verify.
Since both the number of vertices and edges match, we can proceed.
2. Check vertex degrees:
The degree of a vertex is the number of edges connected to it. Let's check the degrees for each vertex:
o Graph 1:
▪ a: 3 (connected to b, c, d)
▪ b: 3 (connected to a, c, e)
▪ c: 3 (connected to a, b, f)
▪ d: 3 (connected to a, e, f)
▪ e: 3 (connected to b, d, f)
▪ f: 3 (connected to c, d, e)
o Graph 2:
▪ a': 3 (connected to b', c', d')
▪ b': 3 (connected to a', c', e')
▪ c': 3 (connected to a', b', f')
▪ d': 3 (connected to a', e', f')
▪ e': 3 (connected to b', d', f')
▪ f': 3 (connected to c', d', e')
Notice that every vertex in Graph 1 has the same degree as its corresponding vertex in Graph 2. This is a good sign!
3. Create a mapping of vertices:
Based on the degrees (which all matched!), we can create a mapping. It looks like a natural fit:
o a maps to a'
o b maps to b'
o c maps to c'
o d maps to d'
o e maps to e'
o f maps to f'
4. Check edge connections:
This is the crucial step. We need to make sure that if two vertices are connected in Graph 1, their corresponding
vertices are connected in Graph 2. Let's check a few:
o Graph 1: a is connected to b. Graph 2: a' is connected to b'. (Correct!)
o Graph 1: b is connected to e. Graph 2: b' is connected to e'. (Correct!)
o Graph 1: c is connected to f. Graph 2: c' is connected to f'. (Correct!)
o Graph 1: d is connected to f. Graph 2: d' is connected to f'. (Correct!)
If you check all the connections, you'll find that they all match up!
Conclusion:
Since the number of vertices, the number of edges, the degrees of the vertices, and the edge connections all match, we
conclude that the two graphs are isomorphic.

7) a) Derive a minimum spanning tree from the given weighted graph using Kruskal's algorithm.

Kruskal's Algorithm Steps (with Example)


1. Sort the edges:
List all the edges (connections) and their weights, then sort them from lightest to heaviest:
• (v1, v4): 1
• (v3, v4): 2
• (v2, v3): 2
• (v1, v5): 3
• (v1, v2): 3
• (v4, v5): 3
• (v2, v5): 4
Sorted edges:
1. (v1, v4): 1
2. (v3, v4): 2
3. (v2, v3): 2
4. (v1, v5): 3
5. (v1, v2): 3
6. (v4, v5): 3
7. (v2, v5): 4
2. Initialize MST:
Start with an empty set to hold the edges of our Minimum Spanning Tree:
MST = {}
3. Add edges (avoiding cycles):
Now, we go through the sorted edges and add them to the MST unless they create a cycle (a closed loop).
• Edge 1: (v1, v4): 1
o Add (v1, v4) to MST. (No cycle)
o MST = {(v1, v4)}
• Edge 2: (v3, v4): 2
o Add (v3, v4) to MST. (No cycle)
o MST = {(v1, v4), (v3, v4)}
• Edge 3: (v2, v3): 2
o Add (v2, v3) to MST. (No cycle)
o MST = {(v1, v4), (v3, v4), (v2, v3)}
• Edge 4: (v1, v5): 3
o Add (v1, v5) to MST. (No cycle)
o MST = {(v1, v4), (v3, v4), (v2, v3), (v1, v5)}
• Edge 5: (v1, v2): 3
o Skip (v1, v2). Adding it would create a cycle: v1 -> v4 -> v3 -> v2 -> v1.
• Edge 6: (v4, v5): 3
o Skip (v4, v5). Adding it would create a cycle: v4 -> v1 -> v5 -> v4.
• Edge 7: (v2, v5): 4
o Skip (v2, v5). Adding it would create a cycle: v2 -> v3 -> v4 -> v1 -> v5 -> v2.
4. All vertices connected:
We stop here because all the vertices (v1, v2, v3, v4, v5) are now connected in our MST.
Result: Minimum Spanning Tree
The edges in the MST are:
• (v1, v4): 1
• (v3, v4): 2
• (v2, v3): 2
• (v1, v5): 3
The total weight of the MST is 1 + 2 + 2 + 3 = 8.

7b) Check whether a Petersen graph shown in Figure has a Hamiltonian cycle or not.

The Petersen graph is a famous 3-regular graph with 10 vertices and 15 edges. It has some interesting properties and
is frequently used in graph theory. One of the key questions about the Petersen graph is whether it contains a
Hamiltonian cycle.
Key Properties of the Petersen Graph:
• It has 10 vertices and 15 edges.
• It is a 3-regular graph, meaning each vertex has a degree of 3.
• The Petersen graph is non-Hamiltonian, meaning it does not contain a Hamiltonian cycle.
Why the Petersen Graph does not have a Hamiltonian Cycle:
• A Hamiltonian cycle is a cycle that visits every vertex exactly once and returns to the starting vertex.
• Despite its simplicity and symmetric structure, the Petersen graph does not have a Hamiltonian cycle.
Proof Outline:
1. Trial and Error: Trying to find a Hamiltonian cycle in the Petersen graph would involve attempting to form a
cycle that includes every vertex exactly once and returns to the starting point. However, this attempt is
unsuccessful because it is impossible to connect the vertices in such a way.
2. Graph Theory Result: It is a well-known result in graph theory that the Petersen graph does not contain a
Hamiltonian cycle. This has been proven through theoretical analysis, where no Hamiltonian cycle can be
formed.
Conclusion:
The Petersen graph does not have a Hamiltonian cycle. This conclusion holds true for all representations of the
Petersen graph, regardless of the specific labeling of vertices or edges.
8a)Determine the minimum spanning tree of the weighted graph shown in the figure.

Using Kruskal’s Algorithm


Step 1: Sort the edges in ascending order of weight
We sort the edges from smallest to largest weight:
1. (B, E, 2)
2. (D, C, 3)
3. (D, A, 4)
4. (C, F, 4)
5. (F, E, 5)
6. (B, C, 5)
7. (A, B, 6)
8. (E, D, 6)
9. (A, F, 7)

Step 2: Initialize the MST and add edges


We start with an empty MST and add edges one by one, ensuring no cycles are formed. We use a disjoint-set (Union-
Find) data structure to keep track of connected components.
Step-by-step edge addition:
1. Add (B, E, 2):
o MST: {(B, E, 2)}
o Total weight: 2
o Connected components: {A}, {B, E}, {C}, {D}, {F}
2. Add (D, C, 3):
o MST: {(B, E, 2), (D, C, 3)}
o Total weight: 2 + 3 = 5
o Connected components: {A}, {B, E}, {C, D}, {F}
3. Add (D, A, 4):
o MST: {(B, E, 2), (D, C, 3), (D, A, 4)}
o Total weight: 2 + 3 + 4 = 9
o Connected components: {A, C, D}, {B, E}, {F}
4. Add (C, F, 4):
o MST: {(B, E, 2), (D, C, 3), (D, A, 4), (C, F, 4)}
o Total weight: 2 + 3 + 4 + 4 = 13
o Connected components: {A, C, D, F}, {B, E}
5. Add (F, E, 5):
o MST: {(B, E, 2), (D, C, 3), (D, A, 4), (C, F, 4), (F, E, 5)}
o Total weight: 2 + 3 + 4 + 4 + 5 = 18
o Connected components: {A, B, C, D, E, F}

Step 3: Stop when all vertices are connected


At this point, all vertices are connected, and the MST contains V−1=5V−1=5 edges (where V=6V=6 is the number of
vertices). We do not need to add any more edges.

Final Minimum Spanning Tree (MST)


The edges in the MST are:
• (B, E, 2)
• (D, C, 3)
• (D, A, 4)
• (C, F, 4)
• (F, E, 5)

Total Weight of the MST


The total weight of the MST is:
2+3+4+4+5=182+3+4+4+5=18
Using Prims Algorithm

Step 1: Initialize the MST


We start with an empty MST and select an arbitrary vertex to begin. Let's choose A as the starting vertex.
• MST: {}
• Visited vertices: {A}
• Edges to consider: All edges connected to A:
o (A, B, 6)
o (A, D, 4)
o (A, F, 7)

Step 2: Add the smallest edge connected to the current tree


From the edges connected to A, the smallest edge is (A, D, 4).
• Add (A, D, 4) to the MST.
• MST: {(A, D, 4)}
• Visited vertices: {A, D}
• Total weight: 4
Now, consider all edges connected to the visited vertices {A, D}:
• (A, B, 6)
• (A, F, 7)
• (D, C, 3)
• (D, E, 6)

Step 3: Add the smallest edge connected to the current tree


From the available edges, the smallest edge is (D, C, 3).
• Add (D, C, 3) to the MST.
• MST: {(A, D, 4), (D, C, 3)}
• Visited vertices: {A, D, C}
• Total weight: 4 + 3 = 7
Now, consider all edges connected to the visited vertices {A, D, C}:
• (A, B, 6)
• (A, F, 7)
• (C, F, 4)
• (C, B, 5)
• (D, E, 6)

Step 4: Add the smallest edge connected to the current tree


From the available edges, the smallest edge is (C, F, 4).
• Add (C, F, 4) to the MST.
• MST: {(A, D, 4), (D, C, 3), (C, F, 4)}
• Visited vertices: {A, D, C, F}
• Total weight: 4 + 3 + 4 = 11
Now, consider all edges connected to the visited vertices {A, D, C, F}:
• (A, B, 6)
• (A, F, 7)
• (C, B, 5)
• (F, E, 5)
• (D, E, 6)
Step 5: Add the smallest edge connected to the current tree
From the available edges, the smallest edge is (C, B, 5).
• Add (C, B, 5) to the MST.
• MST: {(A, D, 4), (D, C, 3), (C, F, 4), (C, B, 5)}
• Visited vertices: {A, D, C, F, B}
• Total weight: 4 + 3 + 4 + 5 = 16
Now, consider all edges connected to the visited vertices {A, D, C, F, B}:
• (A, B, 6)
• (A, F, 7)
• (F, E, 5)
• (D, E, 6)
• (B, E, 2)

Step 6: Add the smallest edge connected to the current tree


From the available edges, the smallest edge is (B, E, 2).
• Add (B, E, 2) to the MST.
• MST: {(A, D, 4), (D, C, 3), (C, F, 4), (C, B, 5), (B, E, 2)}
• Visited vertices: {A, D, C, F, B, E}
• Total weight: 4 + 3 + 4 + 5 + 2 = 18

Step 7: Stop when all vertices are connected


All vertices are now connected, and the MST contains V−1=5V−1=5 edges (where V=6V=6 is the number of vertices).
We do not need to add any more edges.

Final Minimum Spanning Tree (MST) using Prim's Algorithm


The edges in the MST are:
• (A, D, 4)
• (D, C, 3)
• (C, F, 4)
• (C, B, 5)
• (B, E, 2)

Total Weight of the MST


The total weight of the MST is:
4+3+4+5+2=18
8) b)What are isomorphic graphs? Explain the various conditions for proving that the given graphs are isomorphic.
Isomorphic Graphs:
Two graphs G1 and G2 are said to be isomorphic if there exists a one-to-one correspondence between their vertices
and edges such that the adjacency relationship is preserved. In other words, if you can relabel the vertices of one graph
to make it identical to the other graph, then the two graphs are isomorphic.
Conditions for Proving Graph Isomorphism:
1. Same Number of Vertices and Edges:
Both graphs must have the same number of vertices and edges. If the number of vertices or edges is different,
the graphs cannot be isomorphic.
2. Same Degree Sequence:
The degree of a vertex is the number of edges connected to it. For two graphs to be isomorphic, their degree
sequences must be identical. This means that the degree of each vertex in one graph must match the degree of
the corresponding vertex in the other graph.
3. Matching Edge Connectivity:
If there is an edge between two vertices in the first graph, there must be a corresponding edge between the
corresponding vertices in the second graph. This means the edges must map onto each other in a way that
preserves connectivity.
4. Same Graph Properties:
Graph properties such as the number of cycles, connectedness, planarity, etc., should be preserved in both
graphs. For example, if one graph is planar, the other must also be planar.
5. Bijective Mapping:
There should be a one-to-one mapping of vertices between the two graphs, such that the mapping preserves
adjacency. This mapping ensures that if two vertices are adjacent in one graph, their corresponding vertices in
the other graph should also be adjacent.
6. Subgraph Preservation:
If a subgraph (a subset of vertices and edges) exists in the first graph, there must be an identical subgraph in
the second graph. This is important for ensuring that structures like cycles, paths, and components are
preserved.
Example:
Consider two graphs, G1 and G2:
• G1: 4 vertices with edges (1,2), (1,3), (2,4), (3,4)
• G2: 4 vertices with edges (a,b), (a,c), (b,d), (c,d)
A one-to-one mapping between vertices 1 -> a, 2 -> b, 3 -> c, and 4 -> d shows that these two graphs are isomorphic.

9) (a) Let G be a connected planar simple graph with 20 vertices and the degree of each vertex is 3. Find the
number of regions in G.
We can use Euler’s formula for planar graphs to determine the number of regions. Euler's formula states:
V-E+R=2
Where:
• V is the number of vertices,
• E is the number of edges,
• R is the number of regions (also known as the number of faces).
Given:
• Number of vertices, V = 20,
• Each vertex has degree 3, so the total degree of all vertices is 3 × 20 = 60. The sum of degrees of all vertices is
twice the number of edges (because each edge is counted twice), so:
2E = 60
E = 30
Now, using Euler's formula:
V-E+R=2
Substitute the values of V and E:
20 - 30 + R = 2
Solve for R:
R = 12
So, the graph G has 12 regions.

9) (b) Explain planar graphs and Hamiltonian graphs with examples.


Planar Graphs:
A planar graph is a graph that can be embedded in the plane, meaning it can be drawn on a flat surface without any
edges crossing each other.
• Conditions for Planarity:
o A graph is planar if it can be drawn in such a way that no two edges intersect except at their
endpoints.
o Kuratowski’s Theorem: A graph is planar if and only if it does not contain a subgraph that is a
subdivision of K5 (complete graph on 5 vertices) or K3,3 (complete bipartite graph with partitions of
size 3).
Example of a Planar Graph:
• A simple triangle with 3 vertices and 3 edges is a planar graph. It can easily be drawn without any edge
crossings.
Hamiltonian Graphs:
A Hamiltonian graph is a graph that contains a Hamiltonian cycle, i.e., a cycle that visits every vertex exactly once
and returns to the starting vertex.
• Hamiltonian Path: A path that visits every vertex exactly once.
• Hamiltonian Cycle: A cycle that visits every vertex exactly once and returns to the starting vertex.
Example of a Hamiltonian Graph:
• Complete Graph K5: The complete graph on 5 vertices is a Hamiltonian graph because you can always find
a Hamiltonian cycle by visiting every vertex exactly once and returning to the starting point.
Example of a Non-Hamiltonian Graph:
• The Petersen graph is a well-known example of a graph that is non-Hamiltonian. Despite having a
symmetric structure, it does not contain a Hamiltonian cycle.
10) Create a minimum spanning tree from the given graph using the DFS algorithm.

To create a Minimum Spanning Tree (MST) using the DFS (Depth-First Search) algorithm, we need to traverse the
graph in a depth-first manner and construct a tree that includes all vertices without forming cycles. However, DFS
alone does not guarantee a minimum spanning tree. Instead, we typically use Kruskal's or Prim's algorithms for
MSTs.
Step 1: Perform DFS Traversal
We start from an arbitrary vertex (e.g., A) and traverse the graph using DFS, keeping track of the edges that form the
spanning tree.

Step 2: Construct the Spanning Tree


As we traverse the graph using DFS, we add edges to the spanning tree if they connect to an unvisited vertex.

DFS Traversal and Spanning Tree Construction


Let’s perform DFS starting from vertex A:
1. Start at A:
o Visit A.
o Add edge (A, B) to the spanning tree.
o Move to B.
2. At B:
o Visit B.
o Add edge (B, C) to the spanning tree.
o Move to C.
3. At C:
o Visit C.
o Add edge (C, D) to the spanning tree.
o Move to D.
4. At D:
o Visit D.
o Add edge (D, I) to the spanning tree.
o Move to I.
5. At I:
o Visit I.
o Add edge (I, J) to the spanning tree.
o Move to J.
6. At J:
o Visit J.
o No unvisited neighbors. Backtrack to D.
7. Back at D:
o Add edge (D, E) to the spanning tree.
o Move to E.
8. At E:
o Visit E.
o Add edge (E, F) to the spanning tree.
o Move to F.
9. At F:
o Visit F.
o Add edge (F, G) to the spanning tree.
o Move to G.
10. At G:
o Visit G.
o Add edge (G, K) to the spanning tree.
o Move to K.
11. At K:
o Visit K.
o Add edge (K, L) to the spanning tree.
o Move to L.
12. At L:
o Visit L.
o No unvisited neighbors. Backtrack to G.
13. Back at G:
o Add edge (G, H) to the spanning tree.
o Move to H.
14. At H:
o Visit H.
o No unvisited neighbors. Backtrack to G.
15. Back at G:
o No unvisited neighbors. Backtrack to F.
16. Back at F:
o No unvisited neighbors. Backtrack to E.
17. Back at E:
o No unvisited neighbors. Backtrack to D.
18. Back at D:
o No unvisited neighbors. Backtrack to C.
19. Back at C:
o No unvisited neighbors. Backtrack to B.
20. Back at B:
o No unvisited neighbors. Backtrack to A.
21. Back at A:
o No unvisited neighbors. Traversal complete.

Final Spanning Tree (Using DFS)


The edges in the spanning tree are:
• (A, B)
• (B, C)
• (C, D)
• (D, I)
• (I, J)
• (D, E)
• (E, F)
• (F, G)
• (G, K)
• (K, L)
• (G, H)

Total Number of Edges in the Spanning Tree


The spanning tree contains V−1=11V−1=11 edges (where V=12V=12 is the number of vertices).
SET-2

SHORTANSWERQUESTIONS:
1) What is the chromatic number of K_n? Explain.
The chromatic number of a graph is the smallest number of colors needed to color the vertices of the graph such that
no two adjacent vertices share the same color.
For the complete graph K_n, every vertex is connected to every other vertex. Therefore, each vertex must have a
unique color to avoid adjacent vertices having the same color. Hence, the chromatic number of K_n is n.

2) What is a minimum spanning tree?


A minimum spanning tree (MST) of a weighted graph is a spanning tree that includes all the vertices of the graph
and has the minimum possible total edge weight. In other words, it is a subset of the edges that connects all vertices
without any cycles and has the least sum of edge weights.

3) What is Euler circuits and Euler paths?


• Euler Circuit: An Euler circuit is a circuit that visits every edge of a graph exactly once and returns to the
starting vertex. For a graph to have an Euler circuit, all its vertices must have an even degree, and the graph
must be connected.
• Euler Path: An Euler path is a path that visits every edge of the graph exactly once, but it may or may not
return to the starting vertex. For a graph to have an Euler path, it must have exactly two vertices with odd
degrees, and the graph must be connected.

4) List different types of graphs.


The different types of graphs include:
• Simple Graph: A graph with no loops and no multiple edges.
• Multigraph: A graph where multiple edges between the same pair of vertices are allowed.
• Complete Graph: A graph where every pair of distinct vertices is connected by a unique edge.
• Bipartite Graph: A graph where vertices can be divided into two disjoint sets such that no two vertices within
the same set are adjacent.
• Directed Graph (Digraph): A graph where the edges have a direction associated with them (i.e., an edge is
an ordered pair of vertices).
• Weighted Graph: A graph where edges have weights or costs associated with them.
• Planar Graph: A graph that can be drawn on a plane without edges crossing.

5) Define isomorphic graphs.


Two graphs are said to be isomorphic if there is a one-to-one correspondence between their vertices and edges such
that the adjacency relationships are preserved. In other words, one graph can be transformed into the other by simply
renaming its vertices. The two graphs have the same structure but may appear different in terms of labeling or layout.
LONGANSWERQUESTIONS:

6a) Discuss the significance of chromatic numbers in graph coloring.


The chromatic number of a graph is the smallest number of colors required to color the vertices of a graph such that
no two adjacent vertices share the same color. The concept of chromatic number plays a significant role in various
applications of graph theory, such as:
• Scheduling problems: When assigning time slots to different tasks (vertices), we use graph coloring to ensure
that no two conflicting tasks (adjacent vertices) are scheduled at the same time.
• Map coloring: In map coloring problems, each region is represented by a vertex, and edges represent
neighboring regions. The chromatic number determines the minimum number of colors needed to color a map
such that no two adjacent regions share the same color.
• Resource allocation: In problems such as frequency assignment in communication networks, the chromatic
number helps determine the minimum number of frequencies (colors) required to avoid interference.
• Optimization problems: Chromatic numbers are used in optimization problems like register allocation in
computer science, where the goal is to minimize the number of registers (colors) used by variables in a
program.
The chromatic number is also important in graph theory for studying the complexity and structure of graphs.

6b) Using Prim's algorithm, determine the minimal spanning tree for a given graph.

To determine the Minimum Spanning Tree (MST) of the given graph using Prim's Algorithm, follow these steps:
Step 1: Initialize
• Choose any vertex to start. Let's choose vertex a to start the algorithm.
• Create a set of visited vertices (initially containing only the starting vertex a).
• Initialize an empty set of edges for the MST.
• The edges list will be updated as we add edges with the least weights.
Step 2: Prim's Algorithm Steps
Iteration 1: Start from vertex a
• From vertex a, we have the following edges:
o a - f (weight 1)
o a - e (weight 2)
o a - b (weight 11)
o a - c (weight 9)
• Choose the edge with the least weight: a - f with weight 1.
• Add vertex f to the visited set.
• Add edge a - f to the MST.
Iteration 2: Add vertex f to the set
• Now, from vertex f, the following edges are available:
o f - a (already in MST)
o f - e (weight 3)
o f - b (weight 8)
o f - c (weight 10)
o f - d (weight 6)
• Choose the edge with the least weight: f - e with weight 3.
• Add vertex e to the visited set.
• Add edge f - e to the MST.
Iteration 3: Add vertex e to the set
• From vertex e, the following edges are available:
o e - a (already in MST)
o e - f (already in MST)
o e - b (weight 8)
o e - c (weight 7)
o e - d (weight 4)
• Choose the edge with the least weight: e - d with weight 4.
• Add vertex d to the visited set.
• Add edge e - d to the MST.
Iteration 4: Add vertex d to the set
• From vertex d, the following edges are available:
o d - e (already in MST)
o d - f (already in MST)
o d - c (weight 5)
• Choose the edge with the least weight: d - c with weight 5.
• Add vertex c to the visited set.
• Add edge d - c to the MST.
Iteration 5: Add vertex c to the set
• From vertex c, the following edges are available:
o c - e (already in MST)
o c - d (already in MST)
o c - b (weight 8)
• Choose the edge with the least weight: c - b with weight 8.
• Add vertex b to the visited set.
• Add edge c - b to the MST.
Iteration 6: All vertices visited
• All vertices are now visited. The algorithm stops here.
Step 3: Resulting Minimum Spanning Tree (MST)
The edges included in the MST are:
1. a - f with weight 1
2. f - e with weight 3
3. e - d with weight 4
4. d - c with weight 5
5. c - b with weight 8
Step 4: Total Weight of the MST
The total weight of the MST is the sum of the edge weights:
• 1 + 3 + 4 + 5 + 8 = 21
Final Minimum Spanning Tree (MST)
• Vertices: a, b, c, d, e, f
• Edges:
o a - f (weight 1)
o f - e (weight 3)
o e - d (weight 4)
o d - c (weight 5)
o c - b (weight 8)
The total weight of the MST is 21.

7)a) Obtain the dual of the planar graph as shown in Figure

To obtain the dual of the given planar graph, follow these steps:
Step 1: Draw the original graph
The graph is given with vertices: A, B, C, D, E, F and the following edges:
• A-B
• B-C
• C-E
• C-F
• F-E
• E-D
• D -A
• A-E
Step 2: Create a new vertex for each region of the graph
Each face (region) of the planar graph, including the outer region, will be represented by a vertex in the dual graph.
• Regions of the original graph:
o Region 1: B - C - E - F
o Region 2: C - F - E - D
o Region 3: A - B - C - D
o Region 4: A - D - E - F
o Region 5: The outer region (not enclosed by any edges)
Step 3: Place a vertex in each region
• Place a vertex for each region:
o Vertex 1: Corresponding to the region B - C - E - F
o Vertex 2: Corresponding to the region C - F - E - D
o Vertex 3: Corresponding to the region A - B - C - D
o Vertex 4: Corresponding to the region A - D - E - F
o Vertex 5: Corresponding to the outer region.
Step 4: Draw edges between dual vertices
Draw an edge between two vertices in the dual graph if the corresponding regions in the original graph share an edge.
• Edge A - B in the original graph corresponds to an edge between Region 3 and Region 1 in the dual graph.
• Edge B - C in the original graph corresponds to an edge between Region 3 and Region 1.
• Edge C - E in the original graph corresponds to an edge between Region 1 and Region 2.
• Edge C - F in the original graph corresponds to an edge between Region 2 and Region 4.
• Edge F - E in the original graph corresponds to an edge between Region 2 and Region 1.
• Edge E - D in the original graph corresponds to an edge between Region 2 and Region 4.
• Edge D - A in the original graph corresponds to an edge between Region 3 and Region 4.
• Edge A - E in the original graph corresponds to an edge between Region 3 and Region 4.
Step 5: Final dual graph
The dual graph will have the following vertices and edges:
• Vertices: 1, 2, 3, 4, 5
• Edges:
o Between vertex 1 and 2
o Between vertex 2 and 4
o Between vertex 4 and 3
o Between vertex 1 and 3
o Between vertex 1 and 4
This is the dual graph of the given planar graph.

7b) Check whether the graphs shown are isomorphic or not.


To check if two graphs are isomorphic, follow these steps:
• Step 1: Compare the number of vertices and edges in both graphs.
• Step 2: Check if there is a one-to-one correspondence between the vertices of the two graphs such that the
adjacency relationships (edges) are preserved.
• Step 3: If such a correspondence exists, the graphs are isomorphic.
If the graphs provided are different in terms of the number of vertices, edges, or their adjacency structure, they are not
isomorphic.

8a) Find the chromatic number of the following graph.


To determine the chromatic number of a graph, follow these steps:
• Step 1: Color the graph starting from the first vertex. Assign the first available color to each vertex, ensuring
no two adjacent vertices share the same color.
• Step 2: Repeat this process for all vertices, and count the number of colors used.

8b) Show that the complete bipartite graph K3,3 is non-planar.


The complete bipartite graph K3,3 consists of two sets of vertices: one set with 3 vertices and another set with 3
vertices, with every vertex in one set connected to all vertices in the other set.
To show that K3,3 is non-planar:
1. K3,3 has 6 vertices and 9 edges.
2. According to Kuratowski's Theorem, a graph is non-planar if it contains a subgraph that is a K5 (complete
graph on 5 vertices) or K3,3.
3. Since K3,3 is a subgraph of itself, it is non-planar.
Thus, K3,3 is non-planar because it cannot be drawn on a plane without edges crossing.

9) Draw and explain the BFS and DFS algorithms for the following graph.
For the BFS (Breadth-First Search) and DFS (Depth-First Search) algorithms, follow these steps:
1. BFS:
o Start at the source vertex.
o Visit all neighbors at the current level before moving to the next level.
o Continue until all vertices are visited.
2. DFS:
o Start at the source vertex.
o Visit the unvisited vertex closest to the source, following each vertex’s unvisited neighbor.
o Backtrack when no more unvisited neighbors are available.

10) Consider the following graph G as shown in the figure. Find its incidence matrix M.

The incidence matrix of a graph represents the relationship between vertices and edges. It is a matrix with
rows representing vertices and columns representing edges. If a vertex is incident to an edge, mark the
corresponding entry with a 1, and 0 otherwise.

Steps to construct the incidence matrix:

1. List all vertices as rows.


2. List all edges as columns.
3. For each edge, mark the vertices that are incident to the edge.

You might also like