Assignment 5
Assignment 5
Assignment 5
Draw the graphs using MS Word or graphonline or hand-drawn images wherever required
in the assignment.
Ensure that you do not take the same examples discussed in the textbooks and resources.
1. In a hostel, there are around ‘n’ number of students (assume a number above 100 for n)
with rooms categorized as triple, double, and single occupancy. Explain how you will
represent the above data as a graph.
You need not create or share the graph but make sure to include justification for the below
questions:
(i) Will the graph be a simple graph or a multigraph?
(ii) Will it have loops?
(iii) What is the possible maximum and minimum degree for each student?
(iv) If all problems are represented in the form of graphs, won’t the problems be easily
visualized and solved? (v)Can we represent every problem with a graph? Explain the reason
by considering an example of a situation that has 11 vertices such that the degree of each
vertex is 11.
A simple graph only allows one edge to connect any two vertices.
There are also no loops, where an edge connects a vertex to itself.
Multi-graph:
A multi-graph allows for multiple edges to connect the same pair of vertices.
Multi-graphs can still not have loops.
In light of our problem, I want to represent students and rooms as vertices and edges that denote
the presence of a student in a room. Since a single student can occupy only one room, and
students can’t occupy other students, the graph will be at most one edge between any two distinct
vertices. Hence, the graph will be a simple graph.
(ii) Will it have loops?
We already established in the preceding question that the graph will be a simple graph and
cannot contain loops.
(iii) What is the possible maximum and minimum degree for each student?
As student can only occupy one room, the maximum degree for each student will be 1. As
students must occupy a room, otherwise they will be homeless, the minimum degree for
each student will be 1.
(iv) If all problems are represented in the form of graphs, won’t the problems be easily visualized
and solved?
Graphs are an extremely effective tool for visualizing problems, but they take a lot of
computations to set up and solve.
The amount of computations needed to solve the problem increases with the number of vertices
and edges.
Using graphs to tackle the problem becomes impractical for very large sets of vertices.
(v) Can we represent every problem with a graph? Explain the reason by considering an
example of a situation that has 11 vertices such that the degree of each vertex is 11.
If the graph is simple, then the maximum degree of each vertex will be n-1, as each vertex
can be connected to every other vertex with one edge, but not itself.
If we don’t have that constraint, then it is possible to have a graph with a degree of 11 for
each vertex.
2. A University is conducting a conference for two days on different subjects for students
pursuing their higher education. Your task is to create a time slot scheduling model for the
conference sessions (based on the subjects attended by students) using graph coloring.
Draw the graph for the same and answer the chromatic number of this problem of
scheduling time slots with the number of subjects your choice.
Solution:
Let’s assume we run session on 3 subjects (Math, Physics, and History) and we have 3 sessions
per day per subject leading to a total of 9 sessions per day. We will have 18 sessions for two
days. An edge between two vertices indicates that the student is attending both the sessions. This
is how the graph representation might appear:
M1 M2 M3
P1 P2 P3
H2 H3
H1
Let’s denote the subject as M, P, and H, and their session as M1, M2, M3, P1, P2, P3,
H1, H2, and H3.
Vertices M1, M2, M3, P1, P2, P3, H1, H2, and H3 represent the sessions for the
respective subjects. Edges between vertices indicate students attending both sessions
connected by the edge.
This graph illustrates the connections between sessions, showing where students attend
multiple sessions across the four subjects. Each vertex represents a specific session, and
the edges between them indicate student attendance in both sessions.
3. Explain Euler and Hamiltonian cycles, and provide one simple counter example for each.
Find the Euler circuit/path and Hamiltonian cycle/path for the given graph G.
Eulerian Path
Eulerian path is a path in graph that visits every edge exactly once. Eulerian Circuit is
an Eulerian Path which starts and ends on the same vertex.
Hamiltonian is similar to Eulerian, but instead of edges, it visits every vertex.
Example:
A graph that has a vertex with odd degree is a counter example for Eulerian Path.
A graph that has a vertex with degree less than 2 is a counter example for
Hamiltonian Path, as it will not be able to visit every vertex.
4. Explain the spanning tree. Find at least two possible spanning trees for the following
graph H and explain how you determined that they are spanning trees. Draw a bipartite
graph from any one of the two spanning trees that you found.
Spanning tree:
A spanning tree is a subset of Graph G, which has all the vertices covered with minimum possible number
of edges.
1 2 3
4 5
Spanning tree 2: 3-6, 3-2, 2-5, 2-1, 1-4
1 2 3
4 5
1
2
5
4
6
Use APA citations and references if you use ideas from the readings or other sources.
Reference: