CS182 Homework # 9
Ayusha Patra
2 April 2024
Answer 1
I, Ayusha Patra, affirm that I have not given or received any unauthorized help on this assignment
and that this work is my own. What I have submitted is expressed and explained in my own words.
I have not used any online websites that provide a solution. I will not post any parts of this problem
set to any online platform and doing so is a violation of course policy.
1
Answer 2
V (G) is the set of vertices.
⇒ V (G) = {V1 , V2 , V3 , V4 , V5 , V6 }
E(G) is the set of edges.
⇒ E(G) = {e1 , e2 , e3 , e4 , e5 , e6 }
IG is the incidence relation, which is a set of pairs that associates each edge with the two vertices (not in any
particular order) that it connects. Since it’s a multigraph, edges may connect a vertex to itself, creating loops.
⇒ IG (e1 ) = {V1 , V5 }
⇒ IG (e2 ) = {V2 , V3 }
⇒ IG (e3 ) = {V2 , V4 }
⇒ IG (e4 ) = {V2 , V5 }
⇒ IG (e5 ) = {V2 , V5 }
⇒ IG (e6 ) = {V3 , V3 }
2
Answer 3a
Let’s calculate the degree of each vertex:
• Vertex 0 is connected to vertices 1 and 9 ⇒ Degree = 2
• Vertex 1 is connected to vertices 0, 2 and 3 ⇒ Degree = 3
• Vertex 2 is connected to vertices 1 and 3 ⇒ Degree = 2
• Vertex 3 is connected to vertices 2, 4, 1 and 8 ⇒ Degree = 4
• Vertex 4 is connected to vertices 3 and 5 ⇒ Degree = 2
• Vertex 5 is connected to vertices 4 and 6 ⇒ Degree = 2
• Vertex 6 is connected to vertices 5 and 7 ⇒ Degree = 2
• Vertex 7 is connected to vertices 6 and 8 ⇒ Degree = 2
• Vertex 8 is connected to vertices 7, 9 and 3 ⇒ Degree = 3
• Vertex 9 is connected to vertices 0 and 8 ⇒ Degree = 2
According to a theorem, a connected multigraph has an Euler path but not an Euler circuit if and only if it
has exactly two vertices of odd degree.
⇒ Here, exactly two vertices 1 and 8 have an odd degree of 3.
Hence, there exist an Euler path.
An Euler path must start at one vertex with an odd degree and end at the other vertex with an odd degree and
should be a simple path containing every edge of G.
In this case, an Euler path could start at vertex 1 and end at vertex 8, or vice versa.
An Euler path in the given graph:
1→2→3→4→5→6→7→8→3→1→0→9→8
3
Answer 3b
An Euler circuit is a path in a graph that starts and ends at the same vertex and visits every edge exactly once.
According to a theorem, a connected multigraph G has an Euler circuit if and only if each of its vertices has
an even degree.
From question 3(a), we know that vertices 1 and 8 have an odd degree. This means there is no Euler circuit as
it currently stands because not all vertices have an even degree.
To make an Euler circuit, we would need to add an edge to the graph that connects the two vertices with odd
degrees, thus increasing their degree by one and making it even.
⇒ In the given graph, we can add an edge between vertices 1 and 8.
Adding this edge would change their degrees from odd to even, and since those are the only two vertices with
an odd degree, adding this single edge would make the degree of every vertex in the graph even.
Let’s calculate the degree of vertex:
• Vertex 0 is connected to vertices 1 and 9 ⇒ Degree = 2
• Vertex 1 is connected to vertices 0, 2, 3 and 8 ⇒ Degree = 4
• Vertex 2 is connected to vertices 1 and 3 ⇒ Degree = 2
• Vertex 3 is connected to vertices 2, 4, 1 and 8 ⇒ Degree = 4
• Vertex 4 is connected to vertices 3 and 5 ⇒ Degree = 2
• Vertex 5 is connected to vertices 4 and 6 ⇒ Degree = 2
• Vertex 6 is connected to vertices 5 and 7 ⇒ Degree = 2
• Vertex 7 is connected to vertices 6 and 8 ⇒ Degree = 2
• Vertex 8 is connected to vertices 3, 7, 9 and 1 ⇒ Degree = 4
• Vertex 9 is connected to vertices 0 and 8 ⇒ Degree = 2
Now, all the vertices have an even degree making it an Euler circuit.
An example of Euler circuit after adding an edge to the current graph:
1→0→9→8→7→6→5→4→3→2→1→3→8→1
4
Answer 4a
A simple graph is an undirected graph with no loops and no multiple edges.
In a simple graph with n vertices, the maximum degree a vertex can have is n − 1 because it can be connected
to all other vertices.
We are given a simple graph with 4 vertices and degrees 1, 5, 2, 3.
In a graph with 4 vertices, a vertex can connect to at most 3 others.
⇒ The vertex with degree 5 is not possible.
Because one of the degrees provided exceeds the possible maximum in a simple graph with 4 vertices, it is
impossible to construct such a graph.
5
Answer 4b
We are given a A simple graph with 9 vertices and degrees 0, 1, 2, 3, 4, 5, 6, 7, 8.
t is not possible to have a vertex of degree 8 and a vertex of degree 0 in this graph.
This is becaue:
• In a simple graph with 9 vertices, a vertex with degree 8 implies that it is connected to every other vertex
in the graph.
• Vertex of Degree 0 means that this vertex is isolated, meaning it has no connections to any other vertices.
⇒ If there is a vertex that connects to every other vertex (degree 8), there cannot logically be another vertex
that connects to no vertices (degree 0), as the vertex with degree 8 must connect to all, including the one
that would otherwise be isolated.
Hence, it is impossible to construct such a graph.
6
Answer 4c
According to Handshake Theorem, the sum of the degrees of the vertices equals twice the number of edges.
We are given a simple graph with 4 vertices and degrees 2, 2, 3, 3.
⇒ For the degrees 2, 2, 3, and 3, their sum is: 2 + 2 + 3 + 3 = 10
⇒ Total number of edges in the graph should be = 10 2 =5
Example:
7
Answer 4d
We are given a simple digraph with 4 vertices, indegrees 3, 3, 3, 0 and outdegrees 2, 2, 2, 3.
According to theorem, the sum of the indegrees must equal the sum of the outdegrees in any graph, because ever
vertex must leave another vertex.
Sum of Indegrees: 3 + 3 + 3 + 0 = 9
Sum of outdegrees: 2 + 2 + 2 + 3 = 9
The sums match, which is consistent with the basic principle of flow in a digraph.
Example:
8
Answer 4e
We are given a simple digraph with indegrees 2, 1, 3, 1 and outdegrees 3, 1, 1, 1.
According to theorem, the sum of the indegrees must equal the sum of the outdegrees in any graph, because ever
vertex must leave another vertex.
Sum of Indegrees: 2 + 1 + 3 + 1 = 7
Sum of outdegrees: 3 + 1 + 1 + 1 = 6
The sums doesn’t match, which is inconsistent with the basic principle of flow in a digraph.
Hence, it is impossible to construct such a graph.
9
Answer 4f
We are given a simple graph with 7 vertices and 22 edges.
In a simple graph, each edge connects a unique pair of vertices. Thus, to determine the maximum number
of edges, we can count the number of distinct pairs of vertices possible.
We have 7 vertices. Selecting two vertices from a set of 7. The order in which you choose the vertices does
not matter (choosing vertex A and then B is the same as choosing B then A).
⇒ The number of ways to choose two items from a set of n items (in our case, vertices) without regard to order
is given by the binomial coefficient n C2 .This coefficient represents the number of possible edges in
a complete graph, which is the maximum for a simple graph.
In our case, n = 7.
7C 7(7−1)
2 = 2 = 21
The calculation shows that a simple graph with 7 vertices can have at most 21 edges. Since we’re given a graph
with 22 edges, which is one more than the maximum possible for 7 vertices in a simple graph, it is impossible
to construct such a graph.
10
Answer 4g
We are given a simple graph with 5 vertices and 10 edges.
In a simple graph, each edge connects a unique pair of vertices. Thus, to determine the maximum number
of edges, we can count the number of distinct pairs of vertices possible.
We have 5 vertices. Selecting two vertices from a set of 5. The order in which you choose the vertices does
not matter (choosing vertex A and then B is the same as choosing B then A).
⇒ The number of ways to choose two items from a set of n items (in our case, vertices) without regard to order
is given by the binomial coefficient n C2 .This coefficient represents the number of possible edges in
a complete graph, which is the maximum for a simple graph.
In our case, n = 5.
5C 5(5−1)
2 = 2 = 10
It is indeed possible to construct a simple graph with 5 vertices and 10 edges.
Example:
11
Answer 4h
We are given a simple graph with 4 vertices, 5 edges, and an Euler path.
Degree of each vertex:
• Vertex A is connected to vertices B and D ⇒ Degree = 2
• Vertex B is connected to vertices A, C and D ⇒ Degree = 3
• Vertex C is connected to vertices B and D ⇒ Degree = 2
• Vertex D is connected to vertices A, B and C ⇒ Degree = 3
According to a theorem, a connected multigraph has an Euler path but not an Euler circuit if and only if it
has exactly two vertices of odd degree.
Vertices B and D have odd degrees (3 each), while A and C have even degrees (2 each), making the graph
possible for an Euler path.
A possible Euler path:
B→D→C→B→A→D
Example:
12
Answer 5
A simple graph is bipartite if and only if it is possible to color the vertices red or blue so that no two adjacent
vertices have the same color.
Using this color theory, we start from vertex 1 and color it’s adjacent vertices 1,2,4 and 0 red. Next moving
onto vertex 2, since it is red, we color it’s adjacent vertices 1,5 and 0 blue.
We can see that a conflict arises since vertex 0 is already red, and vertex 2 is also red which makes two
adjacent vertices have same color.
Hence, this graph is not bipartite.
We can remove an edge to form a bipartite graph.
Removing the edge between vertices 1 and 0 would break all the triangles involving this edge, we can check
for bipartiteness by attempting to color the remaining graph with two colors:
13
The two sets of vertices V1 and V2 are as follows:
V1 = {Nodes colored red} = {1, 0, 5}
V2 = {Nodes colored blue} = {2, 3, 4}
The edge that was removed to achieve this bipartite graph is the edge connecting nodes 1 and 0.
14
Answer 6
Represent the situation with a graph G = (V, E), where each UTA is a vertex, and an edge between two
vertices represents a handshake between two UTAs. The given condition specifies that for any set of 4
vertices (UTAs), there is always one vertex connected (handshake) to the other three.
Proof by Cases:
Case 1: Everyone shook hands with each other
• There are a total of n UTAs. If all UTAs shook hands with each other, this describes a complete graph Kn .
• In a complete graph Kn , each vertex has a degree of n − 1, meaning each vertex is connected to
every other vertex.
• If everyone has shaken hands with each other, then clearly every UTA has a handshake count of n − 1,
fulfilling the condition that among any 4 UTAs, there exists one who has shaken hands with n − 1 UTAs
and in fact, every UTA has.
Case 2: There exists at least two people who have not shaken hands
• Not every pair of UTAs has shaken hands, indicating that the graph is not complete and contains some
vertices u and v such that there is no edge between them.
• By the problem’s condition, in any set of 4 UTAs, at least one UTA must have shaken hands with the
other three.
• Consider four UTAs: u,v, and two others, x and y, where u and v have not shaken hands. The condition
says one of these four must have shaken hands with the other three.
⇒ If u shakes hands with x and y, but not v, either x or y must connect u,v, and the other, suggesting x or
y are highly connected.
• Extending this scenario to other groups of 4 including u and v with different UTAs. Given that u and v do
not connect, repeated applications of the condition for different groups ensure that many other UTAs must
connect to both u and v, and hence to each other, to satisfy the handshake condition.
• This necessity for many UTAs to be connected to both u and v to maintain the condition incrementally
increases the degree of several UTAs, especially those who are repeatedly part of these 4-person
handshake groups.
• Since the condition must be met for any selection of 4 UTAs, and given the non-complete nature of the graph,
it is likely that at least one UTA ends up being part of many such handshake triads, pushing their total
handshake count towards n − 1.
Hence, by using proof by cases we helped Bob prove that among any 4 UTAs, there exists a UTA that has
shaken hands with (n - 1) UTAs.
15