0% found this document useful (0 votes)
16 views

Math Assignment 7

Math

Uploaded by

givematenga3
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Math Assignment 7

Math

Uploaded by

givematenga3
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Math Assignment 7

Question 1
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.
Modeling the Hostel with a Graph
Imagine the students as vertices (nodes) in the graph. We can connect them with edges to represent their
room assignments. Here's how the room types can be modeled with edges:
 Triple occupancy: An edge connects three students who share a triple room.
 Double occupancy: An edge connects two students who share a double room.
 Single occupancy: A student in a single room won't have any edges connecting them to other
students in this specific room assignment model ( Jamaloodeen et al, 2021).
Justification for Graph Properties:
(i) Simple vs. Multigraph: This scenario calls for a simple graph. A simple graph allows only one edge
between any two vertices. In our hostel scenario, students will only share one room with others, and
roommates will only have one connection representing that shared space ( Jamaloodeen et al, 2021).
(ii) Loops: No loops will be present in this graph. Loops represent a connection between a vertex and itself,
which doesn't make sense in this context. Students cannot share a room with themselves.
(iii) Degree of a Student (Vertex):
 Maximum Degree: In a triple room, a student can have a maximum degree of 2 (connected to two
other students). This is the highest possible number of roommates for a student.
 Minimum Degree: A student in a single room will have a degree of 0 (no edges connected). In some
cases, a student could be assigned a double room but not have a roommate yet. In that case, their
degree would be 1 (connected to the empty slot representing the potential roommate) ( Jamaloodeen
et al, 2021).
 (iv) Problems and Visualization with Graphs: Representing problems as graphs can be a powerful
tool for visualization and problem-solving. Graphs allow us to see the relationships between different
elements of a problem. This visual representation can help identify patterns, solve routing problems,
analyze network structures, and more. However, it's important to note that not all problems are
naturally suited to graph representation ( Jamaloodeen et al, 2021).
(v) Not all Problems are Representable by Graphs:
Consider a scenario with 11 vertices, where each vertex has a degree of 11. This situation cannot be
accurately represented by a simple graph. A simple graph adheres to the rule that a maximum of one edge
can exist between any two vertices. In this case, if all 11 vertices are connected to each other, we would have
multiple edges between vertices, violating the rule of a simple graph ( Jamaloodeen et al, 2021).
Here's an alternative way to represent this scenario using a graph:
 If the connections represent some sort of hierarchical relationship (e.g., communication flow,
information dissemination), a directed acyclic graph (DAG) could be an option. A DAG allows for
one-way connections between vertices but disallows cycles to avoid infinite loops ( Jamaloodeen et
al, 2021).
 If the connections are more general and there can be cycles, a multigraph could be used. A
multigraph allows for multiple edges between the same pair of vertices.
However, it's important to remember that using a graph might not be the most intuitive or efficient way to
represent every problem, especially when the relationships between elements are not naturally suited to a
two-dimensional network structure ( Jamaloodeen et al, 2021).
Question 2
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.
Example of Subjects:

1. Define the vertices:


 Each vertex represents a session.
 Vertices: A1, A2, A3, A4, B1, B2, B3, B4, C1, C2, C3, C4, D1, D2, D3, D4.
2. Define the edges:
 An edge between two vertices indicates that at least one student is attending both sessions,
meaning these sessions cannot be scheduled at the same time.
3. Graph Representation:
 We will represent the given sessions and the edges in a graph.
Graph Analysis:
1. Vertices: A1, A2, A3, A4, B1, B2, B3, B4, C1, C2, C3, C4, D1, D2, D3, D4.
2. Edges:
 A1-A2, A1-B1, A1-B2, A2-A3, A2-B2, A3-A4, A3-B3, A4-B3, A4-B4
 B1-B2, B1-C1, B1-C2, B2-B3, B2-C2, B3-B4, B3-C3, B4-C3, B4-C4
 C1-C2, C1-D1, C1-D2, C2-C3, C2-D2, C3-C4, C3-D3, C4-D3, C4-D4
 D1-D2, D2-D3, D3-D4
Constructing the Graph:
To visualize and color this graph, I started by noting that vertices sharing an edge cannot share the same
color.
Graph Coloring and Chromatic Number:
1. Greedy Coloring Algorithm:
 Start with an uncolored vertex.
 Assign the smallest available color that has not been used by its adjacent vertices.
2. Chromatic Number:
 The chromatic number is the minimum number of colors required to color the graph such that
no two adjacent vertices share the same color.
Applying Graph Coloring:
 Step-by-step Coloring:
1. A1: Color 1
2. A2: Color 2 (A1-A2)
3. A3: Color 1 (A2-A3)
4. A4: Color 2 (A3-A4)
5. B1: Color 2 (A1-B1)
6. B2: Color 1 (A1-B2, B1-B2)
7. B3: Color 3 (B2-B3)
8. B4: Color 1 (B3-B4)
9. C1: Color 3 (B1-C1)
10. C2: Color 1 (B1-C2, C1-C2)
11. C3: Color 2 (C2-C3)
12. C4: Color 1 (C3-C4)
13. D1: Color 2 (C1-D1)
14. D2: Color 3 (C1-D2, D1-D2)
15. D3: Color 1 (D2-D3)
16. D4: Color 2 (D3-D4)
Chromatic Number:
 After coloring, we can see that the minimum number of colors required to color the graph such that
no two adjacent vertices share the same color is 3.
Thus, the chromatic number for this scheduling problem is 3.
Scheduling Model:
 Time Slots: We need 3 different time slots.
 Assignment:
 Time Slot 1: A1, A3, A4, B2, B4, C2, C4, D3
 Time Slot 2: A2, B1, C3, D1, D4
 Time Slot 3: B3, C1, D2
This ensures that no student has conflicting sessions within the same time slot.

Question 3
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.

A Euler cycle is a cycle in a graph that visits every edge exactly once and returns to the starting vertex. An
Euler path is a path that visits every edge exactly once but does not necessarily return to the starting vertex.
Counterexample for Euler Cycle/Path:
A simple counterexample for an Euler cycle is a graph where all vertices have an odd degree. For instance,
consider a graph with three vertices A, B, and C, where each vertex is connected to the other two vertices. In
this scenario, there is no Euler cycle or path because all vertices have an odd degree (GeeksforGeeks, 2023).
Hamiltonian Cycle and Path
A Hamiltonian cycle is a cycle in a graph that visits every vertex exactly once and returns to the starting
vertex. A Hamiltonian path is a path that visits every vertex exactly once but does not necessarily return to
the starting vertex (Prepbytes, 2023).
Counterexample for Hamiltonian Cycle/Path:
A simple counterexample for a Hamiltonian cycle is a graph where one vertex has a degree of 1. For
example, consider a graph with four vertices A, B, C, and D, where A is connected to B, B is connected to C,
C is connected to D, and D is connected to A. In this case, there is no Hamiltonian cycle or path because
vertex D has a degree of 1. (GeeksforGeeks, 2023).
Euler and Hamiltonian Paths/Cycles in Graph G
To find the Euler circuit/path and Hamiltonian cycle/path for a given graph G, we need to analyze the
graph's structure and connectivity. However, since the specific graph G is not provided, we cannot determine
the exact paths or cycles (Prepbytes, 2023).
To determine the Euler circuit/path and Hamiltonian cycle/path for graph G, you would need the list of
vertices and edges. If I could get the information it easier to apply appropriate algorithms or techniques to
find the Eulerian and Hamiltonian paths/cycles:
 For Eulerian paths/cycles: we can verify if all vertices have even degrees for an Eulerian cycle, or
exactly two vertices have odd degrees for an Eulerian path (GeeksforGeeks, 2023).
 For Hamiltonian paths/cycles: we can use backtracking algorithms or heuristics like the
Hamiltonian path problem, which is generally solved using dynamic programming or search
algorithms (GeeksforGeeks, 2023).
Question 4
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.

Building on the concept of graphs, a spanning tree is like a special network. It connects all the points
(vertices) together, but in a very specific way. There are no circles or loops (cycles) – you can always get
from one point to another, but you can't take a circular route.
A Bipartite Graph is a type of graph that can be divided into two distinct sets, known as Bipartite Sets, where
edges exclusively link vertices from one set to vertices in the other set. This means that there are no edges
connecting vertices within the same set (Prepbytes, 2023).
Here is the Bipartite Graph of Spanning Tree H2 I completed for question 4

Bipartite Graph of Spanning Tree H2.


Reference:
GeeksforGeeks. (2023). Eulerian path and circuit for undirected graph
https://www.geeksforgeeks.org/eulerian-path-and-circuit/
Lippman, D. (2020). Spanning Trees. Mathematics LibreTexts.
https://math.libretexts.org/Bookshelves/Applied_Mathematics/Math_in_Society_(Lippman)/
06%3A_Graph_Theory/6.07%3A_Spanning_Trees
Jamaloodeen, M., Pinzon, K., Pragel, D., Roberts, J., & Siva, S. (2021). Discrete Math (3rd ed.). licensed
under CC BY-NC
Prepbytes. (2023). Bipartite Graph. PrepBytes Blog. https://www.prepbytes.com/blog/graphs/bipartite-
graph-and-example/

You might also like