1

1(a) ✅

1(a) https://www.youtube.com/watch?v=pGe2uSidWEY

Okay, let’s use the video to walk through the proof that .

(Video 0:03 - 0:17) The video starts by stating the Theorem: For any graph G, the chromatic number (the minimum number of colours needed for a proper vertex colouring) is less than or equal to (the maximum degree of any vertex in G, plus one).

(Video 0:37 - 0:41) The proof method is Induction on n, where n is the number of vertices in the graph.

(Video 0:57 - 1:22) Base Case: We start with the smallest possible graph, .

  • This graph is just a single vertex ().
  • You need only 1 colour to colour it ().
  • The maximum degree is 0, since there are no edges ().
  • The theorem says . For , this is , which is true. The base case holds.

(Video 1:22 - 1:33) Inductive Hypothesis (IH): We assume the theorem is true for all graphs that have vertices. That is, we assume that for any graph with vertices, we know .

(Video 1:33 - 4:17) - Inductive Step: Now, we need to prove the theorem is true for a graph with vertices, using the assumption (IH) about graphs with vertices.

  1. (1:41 - 1:58) Take any graph with vertices. Pick any vertex from . Consider the graph (the graph with vertex and all edges connected to it removed). has vertices.

  2. (1:58 - 2:22) Since has vertices, we can apply the Inductive Hypothesis to it. The IH tells us that can be coloured with at most colours. Let’s imagine we have such a valid colouring for all vertices in .

  3. (2:22 - 2:59) Now, we add the vertex back. We need to assign a colour to . The only rule is that ‘s colour must be different from the colours of its neighbours.

    • How many neighbours does have in the original graph G? It has neighbours.
    • We know must be less than or equal to the maximum degree in G, i.e., .
    • So, vertex has at most neighbours. These neighbours are already coloured (since they are in ).
  4. (3:00 - 4:15) The neighbours of use up at most colours from the available pool. We need to show we have enough colours total so there’s always one left for . The video considers two cases based on how relates to :

    • Case 1 (Video 3:04 - 3:36):

      • From step 2, we know can be coloured with at most colours. Since , this means uses at most colours. Let’s consider this set of colours as our palette.
      • The neighbours of forbid at most colours from this palette.
      • Since we have colours available in the palette and at most are forbidden by neighbours, there is at least one colour left in the palette that we can assign to .
      • Assign that available colour to . Now the entire graph is coloured using at most colours. The theorem holds for this case.
    • Case 2 (Video 3:37 - 4:15):

      • If the maximum degrees aren’t equal, removing must have lowered the maximum degree. So, . This means .
      • From step 2, we know can be coloured using at most colours.
      • The video’s logic (3:51): Let’s colour (using colours) and then use a completely new colour just for .
      • How many colours did we use in total? We used (colours for ) + 1 (for ). This is .
      • Now substitute the inequality from the start of this case: Total colours .
      • So, even by using a potentially new colour for , we still only needed at most colours for the whole graph . The theorem holds for this case too.

(Video 4:15 - 4:17) Conclusion: Since the theorem holds for both possible cases, the inductive step is complete. By the principle of mathematical induction, the theorem is true for all graphs .

(Video 4:24 - End) The video then discusses examples like complete graphs () and odd cycles () where equality holds (), proving the bound is “tight” in general. It also mentions Brooks’ Theorem, which states that for most other graphs, you can actually do better: .

1(b) ✅

b. Prove that G is bipartite iff the chromatic number of G is 2. (Solution from page 8, 43)

Direction 1: If G is bipartite, then . ()

  1. Assume G is bipartite: What does this mean by definition? It means we can split all the vertices into two separate groups, let’s call them and , such that:

    • Every vertex is in either or , and no vertex is in both (, ).
    • Crucially, all edges in the graph only connect a vertex from group to a vertex from group . There are no edges connecting two vertices within , and no edges connecting two vertices within .
  2. Show : We need to show that the minimum number of colors needed is 2.

    • Can we color it with 2 colors? Yes! Use the partition and . Assign Color 1 to all vertices in group . Assign Color 2 to all vertices in group .
    • Is this a proper coloring? Consider any edge . Since G is bipartite with partition , one endpoint (say ) must be in and the other () must be in . So gets Color 1 and gets Color 2. Since the colors are different, the edge is properly colored. This applies to all edges.
    • Can we use fewer than 2 colors? If the graph has at least one edge (which is implied by “non-trivial graph” or if ), then we need at least 2 colors. We cannot use just 1 color.
    • Conclusion for Direction 1: Since we found a proper coloring with exactly 2 colors, and we can’t use fewer, the minimum number of colors needed () is exactly 2.

Direction 2: If , then G is bipartite. ()

  1. Assume : What does this mean? It means there exists a proper coloring of G using exactly two colors (say, Color 1 and Color 2).
  2. Construct the partition: Use this coloring to define our sets and . Let be the set of all vertices colored with Color 1. Let be the set of all vertices colored with Color 2.
  3. Show it’s a bipartite partition:
    • Does ? Yes, every vertex received one of the two colors.
    • Is ? Yes, no vertex can have both colors.
    • Are there edges within X? No. If an edge existed with both , then both and would have Color 1. But since the coloring is proper, adjacent vertices must have different colors. So, no edge can exist within .
    • Are there edges within Y? No, for the same reason (both would have Color 2, violating proper coloring).
  4. Conclusion for Direction 2 (Direct): Since we constructed a partition of the vertices such that there are no edges within and no edges within , the graph G fits the definition of a bipartite graph.

2

Q2 (Page 1)

2(a) ✅

a. The Prufer sequence S of a labelled tree T is S= {1, 7, 6, 6, 1}. Draw the tree T describing all the intermediate steps pictorially during the process. (Solution from pages 9-17, 37)

Length = 5 . .

  1. , . Smallest . Join 2 to . Edge (2,1). , .
  2. , . Smallest . Join 3 to . Edge (3,7). , .
  3. , . Smallest . Join 4 to . Edge (4,6). , .
  4. , . Smallest . Join 5 to . Edge (5,6). , .
  5. , . Smallest . Join 7 to . Edge (7,1). , .
  6. Remaining L = {1, 6}. Join 1 to 6. Edge (1,6).

Final Edges: {(2,1), (3,7), (4,6), (5,6), (7,1), (1,6)}. Tree T:

graph TD
    1 --- 2;
    1 --- 6;
    1 --- 7;
    7 --- 3;
    6 --- 4;
    6 --- 5;

2(b) ✅

b. Write the algorithm of the same. (Solution from pages 9-11, 37)

Algorithm: Prufer Sequence S to Labelled Tree T Input: , . Output: Edges of T.

  1. . .
  2. While is not empty:
    • Find smallest such that .
    • Join to (first element of ). Add to .
    • Delete from . Delete from .
  3. Join the remaining 2 items in via an edge. Add to .
  4. Return .

3

Q3 (Page 1)

3(a) ✅

a. Prove by method of induction that a graph G is a tree iff G is acyclic and the number of edges m in G is equal to n-1, where n is the number of vertices in G. (Solution from page 18-19, 35) Okay, let’s break down the proof shown in the video (which corresponds to Q3.a on your exam sheet) step-by-step.

The Theorem (stated at 0:59): A graph G is a tree if and only if () G is acyclic and the number of edges () equals the number of vertices () minus 1 ().

Because it’s an “if and only if” statement, we need to prove two things:

Part 1: () If G is a tree, then G is acyclic and . (Video 2:05 - 7:37)

  1. Acyclicity: If G is a tree, it must be acyclic. This is part of the definition of a tree (a tree is a connected, acyclic graph). The video confirms this around 2:16 - 2:27. (Check mark for acyclic part!)
  2. Prove m = n-1: The video proves this using induction on the number of vertices (n).
    • Base Case (n=1): (Video 3:01) If a tree has only 1 vertex, it has 0 edges. . The formula becomes , which is true. So the base case holds.
    • Inductive Hypothesis (IH): (Video 3:30) Assume that for all trees with fewer than vertices (specifically, for trees with vertices, assuming ), the formula holds (i.e., they have edges). The video states it slightly differently but means the same: “Suppose all trees of order n have n-1 edges” - this is assuming the statement holds for the step before the one we’re trying to prove.
    • Inductive Step (Prove for n vertices): (Video 4:11 onwards)
      • Take any tree T with vertices ().
      • Fact: Every tree with vertices must have at least two “leaves” (vertices with degree 1). (Video 4:55 - 5:03).
      • Pick one leaf vertex, call it . (Video 5:20).
      • Consider the graph (remove the vertex and the single edge connected to it). (Video 5:52).
      • is still connected and has no cycles (removing a leaf doesn’t disconnect a tree or create cycles). So, is also a tree.
      • has vertices.
      • Apply the IH to : Since is a tree with vertices, by our assumption (IH), must have edges. (Video 6:10 - 6:32).
      • Relate back to T: How many edges does the original tree T have? It has all the edges of plus the one edge we removed with . So, T has edges. (Video 6:44 - 7:07).
    • Conclusion for Part 1: We’ve shown that if G is a tree, it’s acyclic (by definition) and it has edges (by induction).

Part 2: () If G is acyclic and , then G is a tree. (Video 7:57 - 13:19)

  1. Goal: We are given G is acyclic and . To show G is a tree, we only need to show G is also connected. (The definition of a tree is connected + acyclic).
  2. Strategy: Let’s see what properties G must have given it’s acyclic and . Consider the connected components of G. Maybe G isn’t connected, maybe it looks like several separate pieces. Let’s say there are connected components: . (Video 8:40).
  3. Properties of Components:
    • Each component is connected (by definition).
    • Each component must be acyclic (because the whole graph G is acyclic).
    • Therefore, each component is itself a tree! (Video 9:50 - 10:22).
  4. Counting Edges:
    • Let component have vertices and edges.
    • Since each is a tree, we can apply the result from Part 1 to it: for each component , . (Video 10:26).
    • The total number of edges in the whole graph G is . (Video 11:14).
    • Substitute : .
    • Split the sum: .
    • The sum of vertices in all components () is just the total number of vertices in G, which is .
    • The sum of ‘1’ k times () is just .
    • So, we found that . (Video 12:01).
  5. Contradiction/Conclusion:
    • We were given in this part of the proof that .
    • But we just calculated from the component properties that .
    • So, it must be that . This can only be true if . (Video 12:43).
    • What does mean? It means there was only one connected component to begin with.
    • Therefore, the graph G must be connected.
  6. Final step for Part 2: We were given G is acyclic, and we just proved it must be connected. An acyclic, connected graph is, by definition, a tree.

Overall Conclusion: Since we proved both directions ( and ), the theorem is true. A graph is a tree if and only if it is acyclic and has edges.

3(b) ❌

b. Deduce that clique decision problem is NP-Hard using Satisfiability problem. (Solution from pages 20-25, 50-51)

Show SAT CDP. Given 3-SAT formula , . Construct Graph :

  • .
  • . (Edges between literals in different clauses, unless they are contradictory). Claim: is satisfiable G has a clique of size .
  • () If F is satisfiable, pick one true literal from each clause . The corresponding vertices form a k-clique because they are from different clauses () and cannot be contradictory (otherwise F wouldn’t be satisfied).
  • () If G has a k-clique , it must contain exactly one vertex from each clause group . The literals corresponding to vertices in form a consistent partial assignment (no and appear, as there’s no edge between them). Set these literals to True. This satisfies F. Since SAT is NP-Complete and SAT CDP, CDP is NP-Hard.

4

Q4 (Page 1)

4(a) ✅

a. Prove that for a simple graph G with n number of vertices (), and E number of edges and genus g satisfies . (Solution from page 26)

Proof: Every face of an embedding on genus surface has edges. . So , . Euler’s formula for genus g: . . Substitute: . Since g is integer, .

4(b) ❌

b. “A necessary and sufficient condition for a graph G to be planar is that for every circuit C of G the auxiliary graph G+(C) is bipartite”, prove it. (Solution from page 27)

Proof:

  • () Necessary: Assume G is planar. Embed G. Any circuit C divides plane into Interior/Exterior. Any bridge B of C lies entirely in Int or Ext. Vertices of are bridges. Edge between bridges if incompatible. Partition bridges into (in Int) and (in Ext). No two bridges in are incompatible (no edge within ). No two bridges in are incompatible (no edge within ). Hence is bipartite.
  • () Sufficient (Contrapositive): Assume G is not planar. By Kuratowski, G contains or subdivision.
    • Case : Choose circuit C = 6-cycle. The 3 remaining path-bridges are pairwise incompatible. , not bipartite.
    • Case : Choose circuit C = 5-cycle. The 5 path-bridges form structure. Can find 3 mutually incompatible bridges. contains , not bipartite. If G is non-planar, such that is not bipartite.

5

Q5 (Page 2)

5(a) ❌

a. Suppose want to schedule some final exams… How many exam slots are necessary? (Solution from pages 32-36)

Model as Graph Coloring: Vertices for courses. Edge if courses conflict. No edge if listed as non-conflicting. Non-conflicting pairs (no edge): (1,2), (1,4), (1,3), (2,3), (1,7), (2,7), (1,8), (2,8), (3,8), (1,5), (2,5), (4,5), (1,6), (2,6), (4,6), (5,6). Edges (conflicts): {(2,4), (3,4), (3,5), (3,6), (3,7), (4,7), (4,8), (5,7), (5,8), (6,7), (6,8), (7,8)}. Find . Coloring (from slides):

  • Slot 1 (Red): {3, 5, 8} (Slide shows 3, 5 colored red)
  • Slot 2 (Green): {4, 6, 7} (Slide shows 4, 6, 7 green)
  • Slot 3 (Blue): {1, 2} (Slide shows 1, 2 blue) Wait, slide 36 shows a 3-coloring: Slot 1 {3137, 1007}, Slot 2 {3203, 3261, 4115}, Slot 3 {3157, 4156, 4118}. Let’s redo coloring for this problem:
  1. 1: Color 1
  2. 2: (1,2) no edge Color 1
  3. 3: (1,3) (2,3) no edge Color 1
  4. 4: Edges (2,4), (3,4). Conflicts C1. Color 2
  5. 5: Edge (3,5). Conflicts C1. No edge (4,5). Color 2
  6. 6: Edge (3,6). No edge (4,6), (5,6). Conflicts C1. Color 2
  7. 7: Edges (3,7), (4,7), (5,7), (6,7). Conflicts C1, C2. Color 3
  8. 8: Edges (4,8), (5,8), (6,8), (7,8). Conflicts C2, C3. No edge (1,8), (2,8), (3,8). Color 1 Colors used: 3. (e.g., clique {3, 4, 7}). Answer: 3 exam slots are necessary.

5(b) ✅

b. Illustrate with an example that any graph is a subgraph of a r-regular graph. (Solution from pages 37-41, 48)

König Theorm

Theorem (König): Every graph with maximum degree is an induced subgraph of some -regular graph .

Proof Idea (Constructive):

The proof constructs the -regular graph iteratively.

  1. Base Case: If the given graph is already -regular, then , and is an induced subgraph of itself. We are done.

  2. Inductive Step: If is not -regular, it must contain at least one vertex with degree . (Specifically, the minimum degree ).

    • Take two identical copies of the current graph (let’s call it , starting with ). Call the copies and .
    • For every vertex in such that , add an edge between in and its corresponding vertex in .
    • Call the resulting graph . Note that the original is an induced subgraph of .
    • The degrees of the vertices that had degree in increase by 1 in . Vertices that already had degree remain unchanged.
    • If is -regular, we stop, and .
    • If is still not -regular (meaning its new minimum degree is still ), repeat this step with .
  3. Termination: This process must terminate because, in each step, we increase the degrees of the lowest-degree vertices. Eventually, all vertices will reach degree . The video suggests this occurs after iterations, resulting in a graph which is -regular and contains the original as an induced subgraph.

Link to original

6

6(a) ✅

a. If a graph G is maximal planar graph with n vertices (n>=3) and m edges then show that m = 3n – 6. (Solution from page 42, 56)

Solution: Take a plane drawing of G with regions. Since G is maximal planar, the boundary of every region is a triangle. Consider (# edges on boundary R). Since each region is a triangle, this sum is . Also, each edge is on the boundary of exactly 2 regions, so each edge is counted twice in the sum. Thus the sum is . Therefore, . By Euler’s Formula for plane graphs, . Substituting into Euler’s Formula gives . Multiplying by 3: . Simplifying: . Rearranging gives .

6(b) ✅

b. For a polyhedron with N number of vertices, E number of edges and F number of faces, prove by method of induction that N – E + F = 2. (Solution from pages 43-44, 58-59)

Proof: (Induction on ). Let . Prove .

  • Basis: . . .
  • Ind. Hyp: Assume for connected planar graphs with .
  • Ind. Step: Let G be connected planar with m edges.
    • Case 1: G is a tree. . .
    • Case 2: G is not a tree. Let be an edge in a cycle. . is connected. . By IH, . So . By induction, holds for all connected planar graphs.

7

Q7 (Page 2)

a. Why running time measurement is important to study? Mention some of the factors affecting the running time of a program. (Solution page 49 mentions ‘open question’)

(Based on general knowledge as solution is not provided) Importance: Predict performance, compare algorithms, assess feasibility, identify bottlenecks, manage resources. Factors: Algorithm design (complexity), input size, input characteristics, hardware (CPU, memory), software environment (OS, compiler, language).

b. Prove that every planar graph has a dual. (Solution page 49 mentions ‘Solved as theorem in Alan Gibson Book’)

(Based on standard construction as solution is not provided) Construction: Given a plane embedding of G.

  1. Place a vertex in each face of G. These are vertices of the dual .
  2. For each edge separating faces and in G, draw an edge connecting and crossing only . These are edges of . This constructs the dual graph .

8

Q8 (Page 2)

a. Discuss the merits and demits of Dijkstra’s Algorithm and Bellman-Ford Algorithm with examples. (Solution page 45 shows example graphs)

  • Dijkstra:
    • Merits: Faster ( or ), conceptually simpler (greedy).
    • Demerits: Fails with negative edge weights, cannot detect negative cycles.
    • Example: Works on first graph (page 45), fails on second graph (page 45).
  • Bellman-Ford:
    • Merits: Handles negative edge weights, detects negative cycles.
    • Demerits: Slower (), cannot find shortest paths if negative cycles exist (but reports them).
    • Example: Works on first two graphs (page 45), detects negative cycle in third graph (page 45).

b. Use Prim’s algorithm to find a minimum spanning tree that takes the following graph as input. (Question on Page 3, Solution on Pages 28-31)

Graph: Vertices A, B, C, D, E, F. Edges with weights. Prim’s Steps (Start C):

  1. Select C. Edges: (C,B,2), (C,E,2), (C,D,3), (C,A,4).
  2. Add (C,B,2). MST = {(C,B)}. Consider edges from B: (B,A,4). Min edge is (C,E,2).
  3. Add (C,E,2). MST = {(C,B), (C,E)}. Consider edges from E: (E,D,4), (E,F,3). Min edge is (C,D,3) or (E,F,3).
  4. Add (E,F,3). MST = {(C,B), (C,E), (E,F)}. Consider edges from F: (F,D,3). Min edge is (C,D,3) or (F,D,3).
  5. Add (C,D,3). MST = {(C,B), (C,E), (E,F), (C,D)}. Consider edges from D: (D,A,4). Min edge is (C,A,4), (B,A,4) or (D,A,4).
  6. Add (C,A,4). MST = {(C,B), (C,E), (E,F), (C,D), (C,A)}. All vertices included.

Result: MST Edges = {(C,B), (C,E), (E,F), (C,D), (C,A)}. Total Weight = .


9

Q9 (Page 3)

a. Find the all pairs shortest paths among all vertices for the following graph using Floyd-Warshall Algorithm (showing all intermediate steps) (Solution on page 48)

Graph vertices {1, 2, 3, 4}. Adjacency (assume weight 1 if edge exists, if not, 0 diagonal): (via k=1: ) (via k=2: ) (via k=3: no changes) (via k=4: no changes)

Final Matrix:

b. Prove that Peterson Graph is non-planar using Kuratowski’s and Wagner’s Theorem as well. (Solution on pages 46-47, 49)

Peterson Graph (PG): 10 vertices, 15 edges. 1. Kuratowski’s Theorem: (Non-planar contains subdivision of or )

  • Proof 1: PG contains a subdivision of . (Diagram on page 46 shows highlighted vertices/edges forming the subdivision).

2. Wagner’s Theorem: (Non-planar contains or minor)

  • Proof 2: PG has a minor. Contract the 5 edges joining the outer cycle to the inner star. The resulting graph (page 47) has 5 vertices and is isomorphic to .

Peterson Graph is non-planar.


10

Q10 (Page 4)

a. Find the maximum flow through the given network using Ford-Fulkerson algorithm. (Solution on pages 60-62, 52)

Network with Source=1, Sink=7. Augmenting Paths:

  1. Path: 1-2-5-7. Bottleneck = . Flow = 5.
  2. Path: 1-3-6-7. Bottleneck = . Flow = 5 + 4 = 9.
  3. Path: 1-2-4-5-7 (From image page 61). Bottleneck = . Flow = 9 + 2 = 11. (Note: page 61 shows path 1-3-6-7 with bottleneck 4, and 1-2-4-5-7 with bottleneck 2. Earlier path 1-2-5-7 had bottleneck 5)

Check residual graph: No more paths from 1 to 7. Maximum Flow = 11.

b. Consider the following graph to find the minimum connected dominating set showing all the intermediate steps during the constructions. (Solution approach using reduction on pages 49-55)

Graph vertices {1, 2, 3, 4, 5, 6}. Edges (1,2), (1,5), (2,3), (2,5), (3,4), (3,6), (5,6). Greedy approach (Maximize coverage while maintaining connectivity):

  1. Calculate N[v]: N[1]={1,2,5}, N[2]={1,2,3,5}, N[3]={2,3,4,6}, N[4]={3,4}, N[5]={1,2,5,6}, N[6]={3,5,6}.
  2. Max coverage |N[v]| is 4 (vertices 2, 3, 5). Choose highest ID: 5. . Covered . Uncovered .
  3. Neighbors of are . Candidates to add:
    • Add 1: Covers none new from .
    • Add 2: Covers {3} from .
    • Add 6: Covers {3} from .
  4. Tie between 2 and 6. Choose highest ID: 6. Add 6. . Connected (edge 5-6 exists). Covered . Uncovered .
  5. Neighbors of are . Candidates to add:
    • Add 1: Covers none new from .
    • Add 2: Covers none new from .
    • Add 3: Covers {4} from .
  6. Choose 3. Add 3. . Connected (edges 5-6, 6-3 exist). Covered .

Minimum Connected Dominating Set: . Size = 3.