Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Assignment 5

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

This week you learned the concepts of trees, planar graphs, Euler, Hamiltonian graphs

coloring, and bipartite graphs. Demonstrate your understanding of these concepts by


answering the following questions.

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.

(i) Will the graph be a simple graph or a multi-graph?


Simple graph:

 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.

Hamiltonian Cycle or Circuit in


a graph G is a cycle that visits
every vertex of G exactly once
and returns to the starting
vertex.” Hamiltonian Path in a
graph G is a path that visits
every
vertex of G exactly once and
Hamiltonian Path doesn’t have
to return to the starting vertex.
It’s
an open path
Hamiltonian Cycle or Circuit in
a graph G is a cycle that visits
every vertex of G exactly once
and returns to the starting
vertex.” Hamiltonian Path in a
graph G is a path that visits
every
vertex of G exactly once and
Hamiltonian Path doesn’t have
to return to the starting vertex.
It’s
an open path
Hamiltonian Cycle or Circuit in
a graph G is a cycle that visits
every vertex of G exactly once
and returns to the starting
vertex.” Hamiltonian Path in a
graph G is a path that visits
every
vertex of G exactly once and
Hamiltonian Path doesn’t have
to return to the starting vertex.
It’s
an open path
Hamiltonian Cycle or Circuit in
a graph G is a cycle that visits
every vertex of G exactly once
and returns to the starting
vertex.” Hamiltonian Path in a
graph G is a path that visits
every
vertex of G exactly once and
Hamiltonian Path doesn’t have
to return to the starting vertex.
It’s
an open path
Hamiltonian Cycle or Circuit in
a graph G is a cycle that visits
every vertex of G exactly once
and returns to the starting
vertex.” Hamiltonian Path in a
graph G is a path that visits
every
vertex of G exactly once and
Hamiltonian Path doesn’t have
to return to the starting vertex.
It’s
an open path
In the given graph G the vertex 3 has an odd degree therefor, Eulerian circuit and path is not
possible.
Hamiltonian path is as follows: 7, 6, 5, 3, 2, 4, and 1
Hamiltonian cycle is as follows: 7, 3, 5, 2, 1, 4, 6, and 7

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.

 Spanning tree 1: 3-2, 2-1, 2-5, 5-4, 5-6

1 2 3

4 5
 Spanning tree 2: 3-6, 3-2, 2-5, 2-1, 1-4

1 2 3

4 5

 Bipartite graph of spanning tree 1:

1
2

5
4

6
Use APA citations and references if you use ideas from the readings or other sources.

Reference:

o Find shortest path. (n.d.). Graph Online.


o Levin, O. (2022). Discrete mathematics: An open introduction (3rd ed.). licensed
under CC 4.0

You might also like