Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
22 views6 pages

Tutorial Week-12 Set-5 Solution

The document discusses graph theory concepts like Hamiltonian cycles, minimum cost Hamiltonian circuits, and chromatic numbers. It provides examples and solutions for determining if a graph contains a Hamiltonian cycle, finding the minimum cost circuit, and calculating the chromatic number for different graphs.

Uploaded by

Arpita Singh
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)
22 views6 pages

Tutorial Week-12 Set-5 Solution

The document discusses graph theory concepts like Hamiltonian cycles, minimum cost Hamiltonian circuits, and chromatic numbers. It provides examples and solutions for determining if a graph contains a Hamiltonian cycle, finding the minimum cost circuit, and calculating the chromatic number for different graphs.

Uploaded by

Arpita Singh
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/ 6

Course-B-Tech.

Type- Core
Course Code- CSET206 Course Name- DAA

Year- 2024 Semester- EVEN


Date- 19/03/2024 Batch- 2022-2025

CO-Mapping
CO1 CO2 CO3
Q1 √
Q2 √ √
Q3 √
Q4 √ √

Objectives
1. Students will be able to solve problem related to Graph Colouring, Hamiltonian Cycle.

1. Given an undirected graph, the task is to determine whether the graph contains a Hamiltonian cycle or not. If
it contains, then find the path.

Solution:

Start with the node 0 .


Apply DFS for finding the Hamiltonian path.
When base case reach (i.e. total no of node traversed == V (total vertex)):
Check weather current node is a neighbour of starting node.
As node 2 and node 0 are not neighbours of each other so return from it.
As cycle is not found in path {0, 3, 1, 4, 2}. So, return from node 2, node 4.

Now, explore another option for node 1 (i.e node 2)


When it hits the base condition again check for Hamiltonian cycle
As node 4 is not the neighbour of node 0, again cycle is not found then return.

Return from node 4, node 2, node 1.


Now, explore other options for node 3.

In the Hamiltonian path {0,3,4,2,1,0} we get cycle as node 1 is the neighbour of node 0.

This is our Hamiltonian cycle.

2. Apply the Brute force algorithm to find the minimum cost Hamiltonian circuit on the graph below.
Solution

To apply the Brute force algorithm, we list all possible Hamiltonian circuits and calculate their weight:

Note: These are the unique circuits on this graph. All other possible circuits are the reverse of the listed ones
or start at a different vertex, but result in the same weights.

From this we can see that the second circuit, ABDCA, is the optimal circuit.

3. Find chromatic number of the following graph-

Solution
Applying Greedy Algorithm, we have-

From here,

• Minimum number of colors used to color the given graph are 2.


• Therefore, Chromatic Number of the given graph = 2.
The given graph may be properly colored using 2 colors as shown below-

4. Find chromatic number of the following graph-

Applying Greedy Algorithm, we have-

From here,

• Minimum number of colors used to color the given graph are 4.


• Therefore, Chromatic Number of the given graph = 4.

The given graph may be properly colored using 4 colors as shown below-

You might also like