Agent Work: HW3: Graph Algorithms
Claude Haiku 4.5 · COMP 182: Algorithmic Thinking
COMP 182: Algorithmic Thinking
Homework 3: Graphs
---
Problem 1: Understanding Graph-theoretic Definitions and Terminology [29 pts]
1.1 Degree Sequences [7 pts]
The *degree sequence* of a graph is the sequence of the degrees of the nodes of the graph in non-increasing order.
What is the degree sequence of:
- K_4?
- C_5?
- K_{m,n}?
1.2 Planar Graphs [4 pts]
Graph g is *planar* if it can be drawn on the plane such that no two edges intersect other than at their endpoints.
Which of the graphs K_2, K_3, K_4, and K_5 are planar? (Reminder: K_n is the complete graph on n nodes.)
Draw the planar ones to demonstrate your answer.
1.3 Course Prerequisites [9 pts]
Consider the following set of CS course prerequisites (COMP 140, MATH 111, MATH 211, and ELEC 220 have no prerequisites):
| Course | Prerequisites |
|---|---|
| MATH 112 | MATH 111 |
| COMP 182 | COMP 140, MATH 211 |
| COMP 215 | COMP 182 |
| COMP 310 | COMP 215 |
| STAT 310 | MATH 112, MATH 211 |
| COMP 311 | COMP 182 |
| COMP 382 | COMP 182, STAT 310 |
| COMP 321 | ELEC 220, COMP 215 |
| COMP 410 | COMP 321, COMP 310, COMP 311 |
(a) Draw a precedence graph that models the courses and their prerequisites. Here, add edges for direct prerequisites only.
(b) Is the graph acyclic? Does it make sense for it to be cyclic? Explain.
(c) For the courses above, what is the smallest number of semesters it would take a student to take all of the courses in the table? Assume that all courses are offered in every semester. More generally, for an arbitrary precedence graph that captures course prerequisites, how would you compute the minimum number of semesters it would take a student to take all of the courses?
1.4 Matchings [9 pts]
A *matching* on graph g = (V, E) is a subset of g's edges such that no two edges have a node in common. A *perfect matching* is a matching where every node is incident with at least one edge in the matching. The *size* of a matching is the number of edges in it.
(a) Give an example of a graph with at least 5 nodes that has a matching of size 2.
(b) Give an example of a graph with at least 5 nodes that has no matching of size 2.
(c) What is the size of a perfect matching (if one exists) for a graph that has n nodes (assume n is even)?
---
Problem 2: Graph-theoretic Problem Formulation [21 pts]
Formulate each of the problems as a graph-theoretic problem. Explicitly describe the input and output.
2.1 Jury Selection [7 pts]
Given a city with n individuals, we need to select m of them for jury duty such that no two of them know each other. Assume we have knowledge about the city and who knows whom.
2.2 Student Groups [7 pts]
Luay wants to divide the students in COMP 182 into as few groups as possible such that in each group every two students like each other (every student must belong to exactly one group). Assume that Luay knows who likes whom in the class.
2.3 Course Scheduling [7 pts]
The computer science department wants to schedule (i.e., assign time slots) the Fall 2023 courses so that no two courses that have at least one student in common are scheduled at overlapping times.
Assumptions: 1. The department knows which students will be taking each of the courses 2. There is a fixed set of k time slots available to schedule courses 3. The department wants to use as few slots as possible (to avoid conflict with other departments and to help with classroom scheduling)
---
Problem 3: Proving Graph-theoretic Results [50 pts]
3.1 Bipartite Bit Vector Graph [10 pts]
We define B_n = (V, E) as the graph whose nodes correspond to all bit vectors of size n such that there is an edge between two nodes if their bit vectors differ in one bit.
For example, B_2 contains four nodes {00, 01, 10, 11} and 4 edges {{00, 01}, {00, 10}, {01, 11}, {10, 11}}.
Prove that B_n is bipartite for an arbitrary n >= 2.
3.2 Bridges and Even Degrees [10 pts]
Let g = (V, E) be a graph. Edge e in E is called a *bridge* if the graph g' = (V, E \ {e}) has more connected components than g.
Prove that if the degrees of all nodes in g are even, then g does not contain a bridge.
3.3 Edge Coloring and Hamiltonian Circuits [10 pts]
Let g = (V, E) be a graph. We say that f : E -> {1, 2, ..., k} is a *k-coloring of the edges* of g if for every two edges e_1 and e_2 that share a node in common we have f(e_1) != f(e_2).
A simple circuit in a graph g that passes through every node of the graph exactly once is called a *Hamiltonian circuit* (Definition 2 in Section 10.5 in the textbook).
Prove that if the degree of each node in g is 3 and g has a Hamiltonian circuit, then there exists a 3-coloring of g's edges.
3.4 Cartesian Product Graphs [20 pts]
An *Euler circuit* in a graph g is a simple circuit that contains every edge of g (Definition 1 in Section 10.5 in the textbook).
Let g_1 = (V_1, E_1) and g_2 = (V_2, E_2) be two connected graphs (reminder: no parallel edges or self loops). We define the *Cartesian Product graph* C = (V_C, E_C) of the two graphs as follows:
- V_C = V_1 x V_2
- E_C = {{(u, x), (v, y)} : {u, v} in E_1 OR {x, y} in E_2}
Prove or disprove each of the following:
(a) If g_1 and g_2 both contain Hamiltonian circuits, then C contains a Hamiltonian circuit.
(b) If g_1 and g_2 both contain Euler circuits, then C contains an Euler circuit.
*Hint: You might find Theorems 1 and 2 in Section 10.5 in the textbook helpful.*
# COMP182 Homework 3
## Student Responses
<!-- Write your solutions below. Add sections for each problem as needed. -->
<!-- Use proper mathematical notation where applicable. -->
[Your solutions here]
COMP182 Homework 3: Graphs
Problem 1: Understanding Graph-theoretic Definitions and Terminology
1.1 Degree Sequences
K_4 (Complete Graph on 4 nodes): In K_4, every node is connected to all other 3 nodes. Therefore, each node has degree 3. Degree sequence: [3, 3, 3, 3]
C_5 (Cycle on 5 nodes): In a cycle, each node is connected to exactly 2 neighbors. Therefore, each node has degree 2. Degree sequence: [2, 2, 2, 2, 2]
K_{m,n} (Complete Bipartite Graph): In the complete bipartite graph K_{m,n}, there are m nodes in one part and n nodes in the other part. Each node in the first part is connected to all n nodes in the second part (degree n), and each node in the second part is connected to all m nodes in the first part (degree m). Degree sequence (in non-increasing order):
- If m ≥ n: [m, m, ..., m (n times), n, n, ..., n (m times)]
- If n > m: [n, n, ..., n (m times), m, m, ..., m (n times)]
- More generally: [max(m,n), max(m,n), ..., min(m,n), min(m,n), ...]
---
1.2 Planar Graphs
K_2 (2 nodes with 1 edge): PLANAR Drawing: A single line segment between two points.
K_3 (3 nodes with 3 edges - a triangle): PLANAR Drawing: A triangle with vertices at three points in the plane.
K_4 (4 nodes with 6 edges): PLANAR Drawing: Can be drawn as a square with a vertex in the middle connected to all four corners, or as a square with the diagonals drawn (the diagonals can be drawn slightly inside/outside to avoid intersection).
K_5 (5 nodes with 10 edges): NOT PLANAR Explanation: By Kuratowski's theorem, K_5 is one of the two fundamental non-planar graphs. K_5 requires more than 2 dimensions to draw without edge crossings. This can be proven by considering Euler's formula for planar graphs: for a connected planar graph, V - E + F = 2 where F is the number of faces. A planar graph has at most 3V - 6 edges. For K_5, we would need 10 ≤ 3(5) - 6 = 9, which is false. Therefore, K_5 cannot be planar.
---
1.3 Course Prerequisites
(a) Precedence Graph:
The precedence graph is a directed acyclic graph (DAG) where an edge from course A to course B indicates that B is a direct prerequisite for A (or equivalently, A depends on B).
Nodes (Courses):
COMP 140, MATH 111, MATH 211, ELEC 220 (no prerequisites)
MATH 112 (prerequisite: MATH 111)
COMP 182 (prerequisites: COMP 140, MATH 211)
COMP 215 (prerequisite: COMP 182)
COMP 310 (prerequisite: COMP 215)
STAT 310 (prerequisites: MATH 112, MATH 211)
COMP 311 (prerequisite: COMP 182)
COMP 382 (prerequisites: COMP 182, STAT 310)
COMP 321 (prerequisites: ELEC 220, COMP 215)
COMP 410 (prerequisites: COMP 321, COMP 310, COMP 311)
Edges (Direct prerequisites only):
MATH 111 → MATH 112
MATH 111 → MATH 111 (starting point)
MATH 211 → COMP 182
MATH 211 → STAT 310
COMP 140 → COMP 182
COMP 182 → COMP 215
COMP 182 → COMP 311
COMP 182 → COMP 382
COMP 215 → COMP 310
COMP 215 → COMP 321
ELEC 220 → COMP 321
STAT 310 → COMP 382
COMP 321 → COMP 410
COMP 310 → COMP 410
COMP 311 → COMP 410(b) Is the graph acyclic?
Yes, the graph is acyclic (it is a DAG).
This makes sense because the prerequisite structure must be acyclic. A cycle in the prerequisite graph would mean that course A requires course B, B requires C, and eventually C requires A (directly or indirectly). This would create an impossible situation where a student cannot complete the required prerequisites. Real course prerequisite systems must be acyclic to be well-defined and implementable.
(c) Minimum number of semesters:
To find the minimum number of semesters, we compute the longest path in the DAG from a node with no prerequisites to a node with maximum dependency depth.
Topological levels:
- Level 1 (Semester 1): COMP 140, MATH 111, MATH 211, ELEC 220 (no prerequisites)
- Level 2 (Semester 2): MATH 112 (needs MATH 111), COMP 182 (needs COMP 140, MATH 211)
- Level 3 (Semester 3): COMP 215 (needs COMP 182), COMP 311 (needs COMP 182), STAT 310 (needs MATH 112, MATH 211)
- Level 4 (Semester 4): COMP 321 (needs ELEC 220, COMP 215), COMP 310 (needs COMP 215), COMP 382 (needs COMP 182, STAT 310)
- Level 5 (Semester 5): COMP 410 (needs COMP 321, COMP 310, COMP 311)
Minimum number of semesters: 5
General algorithm for arbitrary precedence graphs: For an arbitrary precedence graph (DAG) representing course prerequisites: 1. Perform a topological sort of the graph 2. Compute the longest path length in the DAG from any source node (course with no prerequisites) to any sink node 3. The minimum number of semesters equals the length of the longest path (counting nodes, not edges) or equivalently, the maximum topological level 4. Alternatively, use a dynamic programming approach: for each node, compute its level as 1 + max(levels of all prerequisite courses), with base case level = 1 for nodes with no prerequisites
---
1.4 Matchings
(a) Example of a graph with at least 5 nodes and a matching of size 2:
Consider a path graph with 5 nodes: 1 - 2 - 3 - 4 - 5
A matching of size 2 could be: {(1,2), (3,4)}
Another example is a star graph with 5 nodes (one central node connected to 4 leaves). A matching of size 2 could be any two edges that don't share a common vertex: {(center, leaf1), (center, leaf2)} - Wait, this doesn't work because both edges share the center. Let me reconsider: in a star with 5 nodes (1 center and 4 leaves), a matching of size 2 would be two edges from different leaves to the center... but that violates the matching condition. Actually, in a star graph, a matching can have at most size 1 because all edges share the central node.
Better example: A cycle of 5 nodes: 1 - 2 - 3 - 4 - 5 - 1
A matching of size 2: {(1,2), (3,4)} ✓
(b) Example of a graph with at least 5 nodes and no matching of size 2:
Consider a star graph K_{1,4} with one central node c and 4 leaves {1, 2, 3, 4}:
Edges: {(c,1), (c,2), (c,3), (c,4)}
Any matching can include at most 1 edge because all edges share the central vertex c. Therefore, this graph has no matching of size 2. ✓
(c) Size of a perfect matching for a graph with n nodes (n even):
A perfect matching is a matching where every node is incident with at least one edge. For a graph with n nodes (where n is even), each edge in a matching covers exactly 2 nodes.
If every node must be incident with at least one edge in the matching, and we want to cover all n nodes with non-overlapping edges, we need exactly n/2 edges.
The size of a perfect matching (if one exists) for a graph with n nodes (n even) is n/2. ✓
---
Problem 2: Graph-theoretic Problem Formulation
2.1 Jury Selection
Problem Formulation:
Input:
- A graph G = (V, E) where:
- V = {individuals in the city} with |V| = n - E = {(u, v) : individuals u and v know each other}
- An integer m (the size of jury to select)
Output:
- A subset S ⊆ V with |S| = m such that for any two distinct nodes u, v ∈ S, there is no edge between u and v in G (i.e., no two people in the jury know each other)
Graph Problem: Find an independent set of size m in G.
The goal is to select m people such that no two of them know each other, which corresponds to finding an independent set (a set of vertices with no edges between them).
---
2.2 Student Groups
Problem Formulation:
Input:
- A graph G = (V, E) where:
- V = {students in COMP 182} - E = {(u, v) : students u and v like each other}
Output:
- A partition of V into the minimum number of disjoint subsets {G_1, G_2, ..., G_k} such that:
- Each G_i is a complete subgraph (clique) of G (every pair of students in the group likes each other) - Every student belongs to exactly one group - k is minimized
Graph Problem: Find the minimum clique cover of G.
Alternatively, this is equivalent to finding a proper coloring of the complement graph G' (where edges exist between students who don't like each other), which is the chromatic number χ(G').
---
2.3 Course Scheduling
Problem Formulation:
Input:
- A graph G = (V, E) where:
- V = {courses to be scheduled in Fall 2023} - E = {(u, v) : courses u and v have at least one student in common}
- An integer k (number of available time slots)
Output:
- A coloring function f: V → {1, 2, ..., k} such that:
- For any edge (u, v) ∈ E, f(u) ≠ f(v) (adjacent courses have different time slots) - k is minimized (use as few time slots as possible)
Graph Problem: Find a proper k-coloring of G, where k is the chromatic number χ(G) of the conflict graph.
This ensures that courses with common students are scheduled in different time slots.
---
Problem 3: Proving Graph-theoretic Results
3.1 Bipartite Bit Vector Graph
Claim: B_n is bipartite for any n ≥ 2.
Proof:
We partition the vertex set V into two disjoint sets based on the parity of the number of 1-bits in each bit vector:
- Set A: All bit vectors with an even number of 1-bits
- Set B: All bit vectors with an odd number of 1-bits
Observation: Every bit vector belongs to either A or B (not both).
Key observation: Two nodes (bit vectors) are connected by an edge in B_n if and only if they differ in exactly one bit.
Claim: All neighbors of a node in A are in B, and vice versa.
Proof of claim:
- If a bit vector x ∈ A has an even number of 1-bits, and we flip exactly one bit to get y:
- If the flipped bit was 0, it becomes 1 (number of 1-bits increases by 1, becoming odd) → y ∈ B - If the flipped bit was 1, it becomes 0 (number of 1-bits decreases by 1, becoming odd) → y ∈ B
- If a bit vector x ∈ B has an odd number of 1-bits, and we flip exactly one bit to get y:
- If the flipped bit was 0, it becomes 1 (number of 1-bits increases by 1, becoming even) → y ∈ A - If the flipped bit was 1, it becomes 0 (number of 1-bits decreases by 1, becoming even) → y ∈ A
Therefore, every edge in B_n connects a node in A to a node in B, and no two nodes in A are adjacent, and no two nodes in B are adjacent.
Conclusion: B_n is bipartite with partition (A, B). ✓
---
3.2 Bridges and Even Degrees
Claim: If all vertices in a graph g = (V, E) have even degree, then g contains no bridge.
Proof:
A bridge is an edge whose removal increases the number of connected components.
Key Lemma: A connected graph has an Eulerian circuit if and only if all vertices have even degree. (Euler's theorem)
An Eulerian circuit is a circuit that traverses every edge exactly once.
Main Proof:
Suppose all vertices in g have even degree. Consider any edge e = {u, v} ∈ E.
Case 1: g is connected.
If g is connected and all vertices have even degree, then g has an Eulerian circuit C. This circuit C is a closed walk that traverses every edge exactly once.
Since C is an Eulerian circuit, both u and v must appear in C. The path from u to v in C (along the circuit) uses only edges in E.
Now consider the graph g' = (V, E \ {e}) (the graph with edge e removed).
Since there is a path from u to v in the Eulerian circuit C that doesn't use the edge e (the path can go the "other way" around the circuit, using different edges), vertices u and v remain connected in g'.
Therefore, removing edge e does not disconnect g, so e is not a bridge.
Case 2: g is disconnected.
A bridge is defined with respect to connected components. An edge e is a bridge if removing it increases the number of connected components. If e is within a connected component, the argument from Case 1 applies. If e is a cut-edge between components, we cannot have all vertices with even degree (the vertices on the boundary would need edges only to other components, making degree counting impossible in a consistent way), but more directly: removing a bridge would increase the number of components. If g is disconnected and all vertices have even degree, each connected component has all vertices with even degree, and the argument from Case 1 applies to each component.
Conclusion: g contains no bridge. ✓
---
3.3 Edge Coloring and Hamiltonian Circuits
Claim: If g = (V, E) has every vertex with degree 3 and contains a Hamiltonian circuit, then there exists a 3-coloring of the edges of g.
Proof:
Let H be a Hamiltonian circuit in g. The circuit H is a cycle that includes every vertex exactly once and uses 2 edges incident to each vertex.
Step 1: Color the edges in the Hamiltonian circuit.
The Hamiltonian circuit H is a cycle. For any cycle (even or odd), we can properly 2-edge-color it:
- Assign color 1 to alternating edges in the cycle
- Assign color 2 to the remaining edges in the cycle
This ensures no two adjacent edges (edges sharing a vertex) in the cycle have the same color.
Verification: In a cycle, at each vertex, one edge has color 1 and one edge has color 2, so they're different. ✓
Step 2: Color the remaining edges.
Since each vertex has degree 3 and the Hamiltonian circuit uses 2 edges per vertex, there is exactly 1 remaining edge incident to each vertex (not in H).
Let F = E \ E(H) be the set of remaining edges. These edges form a 1-regular spanning subgraph of g (i.e., a perfect matching).
Key property of a matching: No two edges in a matching share a vertex.
Step 3: Assign color 3 to all edges in F.
Since no two edges in the matching F share a vertex, we can safely assign color 3 to all of them without creating a conflict (two edges with the same color sharing a vertex).
Conclusion: We have a 3-coloring of all edges: use colors {1, 2} for H (properly 2-colored) and color 3 for F. ✓
---
3.4 Cartesian Product Graphs
Definition: The Cartesian product of two connected graphs g₁ = (V₁, E₁) and g₂ = (V₂, E₂) is C = (V_C, E_C) where:
- V_C = V₁ × V₂
- E_C = {{(u, x), (v, y)} : {u, v} ∈ E₁ OR {x, y} ∈ E₂}
Key observation about edges: Two nodes (u, x) and (v, y) are adjacent in C if and only if:
- u = v and {x, y} ∈ E₂ (edge in the g₂ direction), OR
- x = y and {u, v} ∈ E₁ (edge in the g₁ direction)
The degree of vertex (u, x) in C is: deg_C(u, x) = deg_{g₁}(u) + deg_{g₂}(x)
---
Part (a): If g₁ and g₂ both contain Hamiltonian circuits, then C contains a Hamiltonian circuit.
Claim: TRUE
Proof:
Let H₁ = v₁, v₂, ..., v_m, v₁ be a Hamiltonian circuit in g₁ (visiting all m vertices) Let H₂ = x₁, x₂, ..., x_n, x₁ be a Hamiltonian circuit in g₂ (visiting all n vertices)
We construct a Hamiltonian circuit in C using a "snake" pattern:
Construction: 1. Start at (v₁, x₁) 2. Follow the H₂ path in the fiber {(v₁, y) : y ∈ V₂}: - (v₁, x₁) → (v₁, x₂) → ... → (v₁, x_n) 3. Move to the next fiber: (v₁, x_n) → (v₂, x_n) [using an edge from H₁] 4. Follow H₂ in reverse in the {(v₂, y) : y ∈ V₂} fiber: - (v₂, x_n) → (v₂, x_{n-1}) → ... → (v₂, x₁) 5. Move to the next fiber: (v₂, x₁) → (v₃, x₁) [using an edge from H₁] 6. Continue alternating: forward/reverse through each fiber, connected by edges from H₁ 7. After processing all m fibers, we return to (v₁, x₁)
Verification:
- We visit each (v_i, x_j) exactly once (all m × n vertices) ✓
- Each step uses an edge in C (either within a fiber using H₂, or between fibers using H₁) ✓
- We return to the starting vertex, forming a circuit ✓
Conclusion: C contains a Hamiltonian circuit. ✓
---
Part (b): If g₁ and g₂ both contain Euler circuits, then C contains an Euler circuit.
Claim: TRUE
Proof:
Recall (Theorem 1 from Section 10.5): A connected graph has an Euler circuit if and only if all vertices have even degree.
Given: g₁ has an Euler circuit, so all vertices in g₁ have even degree. Given: g₂ has an Euler circuit, so all vertices in g₂ have even degree.
Claim: All vertices in C have even degree.
Proof of claim:
- For any vertex (u, x) in C:
- deg_C(u, x) = deg_{g₁}(u) + deg_{g₂}(x) - Since deg_{g₁}(u) is even and deg_{g₂}(x) is even: - deg_C(u, x) = even + even = even ✓
Is C connected?
Both g₁ and g₂ are given as connected. For any two vertices (u, x) and (u', x') in C:
- Use a path in g₁ from u to u' to move between fibers (staying in x-coordinate)
- Use a path in g₂ from x to x' within the u'-fiber
This shows C is connected. ✓
Conclusion:
By Theorem 1 (Euler's criterion):
- C is connected ✓
- All vertices in C have even degree ✓
- Therefore, C has an Euler circuit ✓
---
Summary
All problems have been addressed:
- Problem 1: Degree sequences, planarity, course prerequisites DAG analysis, and matching definitions
- Problem 2: Formulations for jury selection (independent set), student groups (clique cover), and course scheduling (graph coloring)
- Problem 3: Complete proofs for bipartite bit vectors, bridges and even degrees, edge coloring with Hamiltonian circuits, and Cartesian product properties
COMP 182 Homework 3: Grading Report
---
Problem 1: Understanding Graph-theoretic Definitions and Terminology [27/29]
1.1 Degree Sequences [7/7]
- K_4: Correct — degree sequence [3, 3, 3, 3]. ✓
- C_5: Correct — degree sequence [2, 2, 2, 2, 2]. ✓
- K_{m,n}: Correct — properly handles the general case with both orderings (m ≥ n and n > m), identifying that the m-part nodes have degree n and the n-part nodes have degree m. ✓
1.2 Planar Graphs [3/4]
- Identification (1/1): Correctly identifies K_2, K_3, K_4 as planar and K_5 as not planar. The K_5 non-planarity justification via Euler's formula (10 > 3·5 − 6 = 9) is a nice bonus. ✓
- Drawings (2/3): K_2 and K_3 descriptions are correct. However, the K_4 description is confused: "a square with a vertex in the middle connected to all four corners" describes a 5-node graph, not K_4. The alternative description "a square with the diagonals drawn" is topologically K_4, but the stated drawing is not planar as described (diagonals cross), and the hand-wavy "drawn slightly inside/outside" doesn't constitute a valid planar drawing. The correct planar embedding is a triangle with one vertex placed inside, connected to all three triangle vertices. −1 pt.
1.3 Course Prerequisites [8/9]
- (a) Precedence Graph (2/3): Most edges are correct, but there are two issues: (1) the spurious self-loop "MATH 111 → MATH 111" and (2) the missing edge MATH 112 → STAT 310 (STAT 310 requires MATH 112 as a prerequisite). −1 pt.
- (b) Acyclic (3/3): Correctly identifies the graph as acyclic with a clear explanation about circular dependencies making courses impossible to complete. ✓
- (c) Minimum Semesters (3/3): Correctly identifies 5 semesters with a complete topological-level breakdown. The general algorithm (longest path in DAG / dynamic programming approach) is well-explained. ✓
1.4 Matchings [9/9]
- (a) (3/3): Valid example — path graph on 5 nodes with matching {(1,2), (3,4)}. The self-correction away from the star graph shows good understanding. ✓
- (b) (3/3): Valid example — star graph K_{1,4} with clear explanation that all edges share the central vertex. ✓
- (c) (3/3): Correct answer of n/2 with proper reasoning that each matching edge covers exactly 2 nodes. ✓
---
Problem 2: Graph-theoretic Problem Formulation [21/21]
2.1 Jury Selection [7/7]
- Correct graph model (nodes = individuals, edges = acquaintance). ✓
- Correct input specification (G = (V, E) with |V| = n and integer m). ✓
- Correct output specification (independent set of size m). ✓
2.2 Student Groups [7/7]
- Correct graph model (nodes = students, edges = mutual liking). ✓
- Correct input specification. ✓
- Correct output (minimum clique cover). The observation about equivalence to chromatic number of the complement graph is a nice addition. ✓
2.3 Course Scheduling [7/7]
- Correct graph model (nodes = courses, edges = shared students). ✓
- Correct input specification including the constraint k. ✓
- Correct output (proper coloring minimizing number of colors, bounded by k). ✓
---
Problem 3: Proving Graph-theoretic Results [44/50]
3.1 Bipartite Bit Vector Graph [10/10]
Excellent proof. The student uses parity of 1-bits (even vs. odd) as the bipartition criterion, which is a valid alternative to the rubric's parity of 0-bits (flipping one bit changes both parities equivalently).
- Bipartition defined clearly (3/3): Sets A (even number of 1s) and B (odd number of 1s) properly partition V. ✓
- No intra-partition edges (4/4): Thorough case analysis showing that flipping any single bit (0→1 or 1→0) changes parity, so neighbors always cross partitions. ✓
- Logical structure (3/3): Clean and well-organized. ✓
3.2 Bridges and Even Degrees [10/10]
The student uses an alternative proof strategy based on Euler circuits rather than the rubric's Handshaking Lemma approach. This is a valid and correct alternative:
1. If g is connected and all degrees are even → g has an Eulerian circuit (by Euler's theorem). ✓ 2. For any edge e = {u, v} in the Eulerian circuit, there exists an alternative path from u to v (traversing the circuit "the other way"). ✓ 3. Therefore, removing e does not disconnect g, so e is not a bridge. ✓ 4. For disconnected graphs, each connected component has all even degrees, so the argument applies component-wise. ✓
This is a clean, elegant proof that correctly leverages the Euler circuit characterization.
3.3 Edge Coloring and Hamiltonian Circuits [7/10]
The proof structure is largely correct, but has a notable gap:
- Proving n is even (0/2): The student skips this critical step. The rubric shows that by the Handshaking Lemma, since each node has odd degree (3), the number of nodes must be even. The student instead claims "For any cycle (even or odd), we can properly 2-edge-color it," which is false — an odd cycle cannot be properly 2-edge-colored (alternating colors produces a conflict at the closing edge). The proof happens to work because n must be even, but the student doesn't establish this. −2 pts.
- 2-coloring the Hamiltonian circuit (1/2): The coloring method (alternating colors) is correct for even cycles, but the incorrect claim that it works for odd cycles is a mathematical error. −1 pt.
- Remaining edges form a matching (3/3): Correctly identifies that since each vertex has degree 3 in g and degree 2 in the Hamiltonian circuit, each vertex has exactly 1 remaining edge, forming a perfect matching. ✓
- Third color completes the argument (3/3): Correctly assigns a third color to the matching edges with no conflicts. ✓
3.4(a) Cartesian Product — Hamiltonian Circuits [8/8]
- Claim TRUE (2/2): ✓
- Construction (4/4): The "snake" pattern is a valid and well-known construction. The student traverses H₂ forward in fiber v₁, moves to fiber v₂ via an H₁ edge, traverses H₂ backward, and so on. Under the given edge definition ({u,v} ∈ E₁ OR {x,y} ∈ E₂), all transitions are valid: within-fiber transitions use E₂ edges, and between-fiber transitions use E₁ edges (consecutive vertices in H₁). The return edge works for both odd and even m because {v_m, v₁} ∈ E₁ satisfies the OR condition. ✓
- Verification (2/2): Correctly verifies all mn nodes visited exactly once and all edges valid. ✓
3.4(b) Cartesian Product — Euler Circuits [9/12]
- Claim TRUE (2/2): ✓
- Connectivity (3/3): Correct argument using paths from g₁ and g₂ to connect arbitrary vertices in C. ✓
- Even degree argument (2/5): The student claims deg_C(u, x) = deg_{g₁}(u) + deg_{g₂}(x), which is the formula for the *standard* Cartesian product (where edges require one coordinate to match). However, the problem defines E_C using OR (not the standard definition), making the actual degree:
deg_C(u, x) = |A|·|V₂| + |B|·|V₁| − |A|·|B|
where A = neighbors of u in g₁, B = neighbors of x in g₂. This is significantly larger than |A| + |B|. The student's formula is incorrect. However, the *conclusion* that the degree is even is still correct (since |A| and |B| are both even, every term in the true formula is even). The rubric's partitioning argument (D₁ = A×B, D₂ = A×(V₂\B), D₃ = (V₁\A)×B, each of even cardinality) is the correct approach. −3 pts for the wrong degree formula, with partial credit for reaching the correct conclusion.
- Logical structure and conclusion (2/2): The overall argument flow is clear and the final application of Euler's theorem is correct. ✓
---
Summary Table
| Problem | Topic | Score | Max |
|---|---|---|---|
| 1.1 | Degree Sequences | 7 | 7 |
| 1.2 | Planar Graphs | 3 | 4 |
| 1.3 | Course Prerequisites | 8 | 9 |
| 1.4 | Matchings | 9 | 9 |
| 2.1 | Jury Selection | 7 | 7 |
| 2.2 | Student Groups | 7 | 7 |
| 2.3 | Course Scheduling | 7 | 7 |
| 3.1 | Bipartite Bit Vectors | 10 | 10 |
| 3.2 | Bridges & Even Degrees | 10 | 10 |
| 3.3 | Edge Coloring / Hamiltonian | 7 | 10 |
| 3.4(a) | Cartesian Product — Hamiltonian | 8 | 8 |
| 3.4(b) | Cartesian Product — Euler | 9 | 12 |
| Total | 92 | 100 |
Overall Comments: This is an excellent submission demonstrating strong understanding of graph theory. The graph formulations (Problem 2) are perfect, and most proofs are rigorous and well-structured. The alternative proof approach for 3.2 (using Euler circuits instead of the Handshaking Lemma) is particularly elegant. The main deductions come from: (1) not proving the Hamiltonian circuit has even length in 3.3, leading to a false general claim about 2-coloring odd cycles; and (2) using an incorrect degree formula for the non-standard Cartesian product in 3.4(b), though the even-degree conclusion happens to remain correct.
Total: 92/100
diff --git a/writeup.md b/writeup.md
index 63ea42f..9a68b32 100644
--- a/writeup.md
+++ b/writeup.md
@@ -1,9 +1,390 @@
-# COMP182 Homework 3
+# COMP182 Homework 3: Graphs
-## Student Responses
+## Problem 1: Understanding Graph-theoretic Definitions and Terminology
-<!-- Write your solutions below. Add sections for each problem as needed. -->
-<!-- Use proper mathematical notation where applicable. -->
+### 1.1 Degree Sequences
-[Your solutions here]
+**K_4 (Complete Graph on 4 nodes):**
+In K_4, every node is connected to all other 3 nodes. Therefore, each node has degree 3.
+**Degree sequence: [3, 3, 3, 3]**
+**C_5 (Cycle on 5 nodes):**
+In a cycle, each node is connected to exactly 2 neighbors. Therefore, each node has degree 2.
+**Degree sequence: [2, 2, 2, 2, 2]**
+
+**K_{m,n} (Complete Bipartite Graph):**
+In the complete bipartite graph K_{m,n}, there are m nodes in one part and n nodes in the other part. Each node in the first part is connected to all n nodes in the second part (degree n), and each node in the second part is connected to all m nodes in the first part (degree m).
+**Degree sequence (in non-increasing order):**
+- If m ≥ n: [m, m, ..., m (n times), n, n, ..., n (m times)]
+- If n > m: [n, n, ..., n (m times), m, m, ..., m (n times)]
+- More generally: [max(m,n), max(m,n), ..., min(m,n), min(m,n), ...]
+
+---
+
+### 1.2 Planar Graphs
+
+**K_2** (2 nodes with 1 edge): **PLANAR**
+Drawing: A single line segment between two points.
+
+**K_3** (3 nodes with 3 edges - a triangle): **PLANAR**
+Drawing: A triangle with vertices at three points in the plane.
+
+**K_4** (4 nodes with 6 edges): **PLANAR**
+Drawing: Can be drawn as a square with a vertex in the middle connected to all four corners, or as a square with the diagonals drawn (the diagonals can be drawn slightly inside/outside to avoid intersection).
+
+**K_5** (5 nodes with 10 edges): **NOT PLANAR**
+Explanation: By Kuratowski's theorem, K_5 is one of the two fundamental non-planar graphs. K_5 requires more than 2 dimensions to draw without edge crossings. This can be proven by considering Euler's formula for planar graphs: for a connected planar graph, V - E + F = 2 where F is the number of faces. A planar graph has at most 3V - 6 edges. For K_5, we would need 10 ≤ 3(5) - 6 = 9, which is false. Therefore, K_5 cannot be planar.
+
+---
+
+### 1.3 Course Prerequisites
+
+**(a) Precedence Graph:**
+
+The precedence graph is a directed acyclic graph (DAG) where an edge from course A to course B indicates that B is a direct prerequisite for A (or equivalently, A depends on B).
+
+```
+Nodes (Courses):
+COMP 140, MATH 111, MATH 211, ELEC 220 (no prerequisites)
+MATH 112 (prerequisite: MATH 111)
+COMP 182 (prerequisites: COMP 140, MATH 211)
+COMP 215 (prerequisite: COMP 182)
+COMP 310 (prerequisite: COMP 215)
+STAT 310 (prerequisites: MATH 112, MATH 211)
+COMP 311 (prerequisite: COMP 182)
+COMP 382 (prerequisites: COMP 182, STAT 310)
+COMP 321 (prerequisites: ELEC 220, COMP 215)
+COMP 410 (prerequisites: COMP 321, COMP 310, COMP 311)
+
+Edges (Direct prerequisites only):
+MATH 111 → MATH 112
+MATH 111 → MATH 111 (starting point)
+MATH 211 → COMP 182
+MATH 211 → STAT 310
+COMP 140 → COMP 182
+COMP 182 → COMP 215
+COMP 182 → COMP 311
+COMP 182 → COMP 382
+COMP 215 → COMP 310
+COMP 215 → COMP 321
+ELEC 220 → COMP 321
+STAT 310 → COMP 382
+COMP 321 → COMP 410
+COMP 310 → COMP 410
+COMP 311 → COMP 410
+```
+
+**(b) Is the graph acyclic?**
+
+**Yes, the graph is acyclic (it is a DAG).**
+
+This makes sense because the prerequisite structure must be acyclic. A cycle in the prerequisite graph would mean that course A requires course B, B requires C, and eventually C requires A (directly or indirectly). This would create an impossible situation where a student cannot complete the required prerequisites. Real course prerequisite systems must be acyclic to be well-defined and implementable.
+
+**(c) Minimum number of semesters:**
+
+To find the minimum number of semesters, we compute the longest path in the DAG from a node with no prerequisites to a node with maximum dependency depth.
+
+**Topological levels:**
+- **Level 1 (Semester 1):** COMP 140, MATH 111, MATH 211, ELEC 220 (no prerequisites)
+- **Level 2 (Semester 2):** MATH 112 (needs MATH 111), COMP 182 (needs COMP 140, MATH 211)
+- **Level 3 (Semester 3):** COMP 215 (needs COMP 182), COMP 311 (needs COMP 182), STAT 310 (needs MATH 112, MATH 211)
+- **Level 4 (Semester 4):** COMP 321 (needs ELEC 220, COMP 215), COMP 310 (needs COMP 215), COMP 382 (needs COMP 182, STAT 310)
+- **Level 5 (Semester 5):** COMP 410 (needs COMP 321, COMP 310, COMP 311)
+
+**Minimum number of semesters: 5**
+
+**General algorithm for arbitrary precedence graphs:**
+For an arbitrary precedence graph (DAG) representing course prerequisites:
+1. Perform a topological sort of the graph
+2. Compute the longest path length in the DAG from any source node (course with no prerequisites) to any sink node
+3. The minimum number of semesters equals the length of the longest path (counting nodes, not edges) or equivalently, the maximum topological level
+4. Alternatively, use a dynamic programming approach: for each node, compute its level as 1 + max(levels of all prerequisite courses), with base case level = 1 for nodes with no prerequisites
+
+---
+
+### 1.4 Matchings
+
+**(a) Example of a graph with at least 5 nodes and a matching of size 2:**
+
+Consider a path graph with 5 nodes: 1 - 2 - 3 - 4 - 5
+
+A matching of size 2 could be: {(1,2), (3,4)}
+
+Another example is a star graph with 5 nodes (one central node connected to 4 leaves). A matching of size 2 could be any two edges that don't share a common vertex: {(center, leaf1), (center, leaf2)} - Wait, this doesn't work because both edges share the center. Let me reconsider: in a star with 5 nodes (1 center and 4 leaves), a matching of size 2 would be two edges from different leaves to the center... but that violates the matching condition. Actually, in a star graph, a matching can have at most size 1 because all edges share the central node.
+
+Better example: A cycle of 5 nodes: 1 - 2 - 3 - 4 - 5 - 1
+
+A matching of size 2: {(1,2), (3,4)} ✓
+
+**(b) Example of a graph with at least 5 nodes and no matching of size 2:**
+
+Consider a star graph K_{1,4} with one central node c and 4 leaves {1, 2, 3, 4}:
+
+Edges: {(c,1), (c,2), (c,3), (c,4)}
+
+Any matching can include at most 1 edge because all edges share the central vertex c. Therefore, this graph has no matching of size 2. ✓
+
+**(c) Size of a perfect matching for a graph with n nodes (n even):**
+
+A perfect matching is a matching where every node is incident with at least one edge. For a graph with n nodes (where n is even), each edge in a matching covers exactly 2 nodes.
+
+If every node must be incident with at least one edge in the matching, and we want to cover all n nodes with non-overlapping edges, we need exactly n/2 edges.
+
+**The size of a perfect matching (if one exists) for a graph with n nodes (n even) is n/2.** ✓
+
+---
+
+## Problem 2: Graph-theoretic Problem Formulation
+
+### 2.1 Jury Selection
+
+**Problem Formulation:**
+
+**Input:**
+- A graph G = (V, E) where:
+ - V = {individuals in the city} with |V| = n
+ - E = {(u, v) : individuals u and v know each other}
+- An integer m (the size of jury to select)
+
+**Output:**
+- A subset S ⊆ V with |S| = m such that for any two distinct nodes u, v ∈ S, there is no edge between u and v in G (i.e., no two people in the jury know each other)
+
+**Graph Problem:** Find an **independent set of size m** in G.
+
+The goal is to select m people such that no two of them know each other, which corresponds to finding an independent set (a set of vertices with no edges between them).
+
+---
+
+### 2.2 Student Groups
+
+**Problem Formulation:**
+
+**Input:**
+- A graph G = (V, E) where:
+ - V = {students in COMP 182}
+ - E = {(u, v) : students u and v like each other}
+
+**Output:**
+- A partition of V into the minimum number of disjoint subsets {G_1, G_2, ..., G_k} such that:
+ - Each G_i is a complete subgraph (clique) of G (every pair of students in the group likes each other)
+ - Every student belongs to exactly one group
+ - k is minimized
+
+**Graph Problem:** Find the **minimum clique cover** of G.
+
+Alternatively, this is equivalent to finding a **proper coloring of the complement graph G'** (where edges exist between students who don't like each other), which is the **chromatic number χ(G')**.
+
+---
+
+### 2.3 Course Scheduling
+
+**Problem Formulation:**
+
+**Input:**
+- A graph G = (V, E) where:
+ - V = {courses to be scheduled in Fall 2023}
+ - E = {(u, v) : courses u and v have at least one student in common}
+- An integer k (number of available time slots)
+
+**Output:**
+- A coloring function f: V → {1, 2, ..., k} such that:
+ - For any edge (u, v) ∈ E, f(u) ≠ f(v) (adjacent courses have different time slots)
+ - k is minimized (use as few time slots as possible)
+
+**Graph Problem:** Find a **proper k-coloring** of G, where k is the **chromatic number χ(G)** of the conflict graph.
+
+This ensures that courses with common students are scheduled in different time slots.
+
+---
+
+## Problem 3: Proving Graph-theoretic Results
+
+### 3.1 Bipartite Bit Vector Graph
+
+**Claim:** B_n is bipartite for any n ≥ 2.
+
+**Proof:**
+
+We partition the vertex set V into two disjoint sets based on the parity of the number of 1-bits in each bit vector:
+
+- **Set A:** All bit vectors with an **even** number of 1-bits
+- **Set B:** All bit vectors with an **odd** number of 1-bits
+
+**Observation:** Every bit vector belongs to either A or B (not both).
+
+**Key observation:** Two nodes (bit vectors) are connected by an edge in B_n if and only if they differ in exactly one bit.
+
+**Claim:** All neighbors of a node in A are in B, and vice versa.
+
+**Proof of claim:**
+- If a bit vector x ∈ A has an even number of 1-bits, and we flip exactly one bit to get y:
+ - If the flipped bit was 0, it becomes 1 (number of 1-bits increases by 1, becoming odd) → y ∈ B
+ - If the flipped bit was 1, it becomes 0 (number of 1-bits decreases by 1, becoming odd) → y ∈ B
+
+- If a bit vector x ∈ B has an odd number of 1-bits, and we flip exactly one bit to get y:
+ - If the flipped bit was 0, it becomes 1 (number of 1-bits increases by 1, becoming even) → y ∈ A
+ - If the flipped bit was 1, it becomes 0 (number of 1-bits decreases by 1, becoming even) → y ∈ A
+
+Therefore, every edge in B_n connects a node in A to a node in B, and no two nodes in A are adjacent, and no two nodes in B are adjacent.
+
+**Conclusion:** B_n is bipartite with partition (A, B). ✓
+
+---
+
+### 3.2 Bridges and Even Degrees
+
+**Claim:** If all vertices in a graph g = (V, E) have even degree, then g contains no bridge.
+
+**Proof:**
+
+A bridge is an edge whose removal increases the number of connected components.
+
+**Key Lemma:** A connected graph has an Eulerian circuit if and only if all vertices have even degree. (Euler's theorem)
+
+An Eulerian circuit is a circuit that traverses every edge exactly once.
+
+**Main Proof:**
+
+Suppose all vertices in g have even degree. Consider any edge e = {u, v} ∈ E.
+
+**Case 1:** g is connected.
+
+If g is connected and all vertices have even degree, then g has an Eulerian circuit C. This circuit C is a closed walk that traverses every edge exactly once.
+
+Since C is an Eulerian circuit, both u and v must appear in C. The path from u to v in C (along the circuit) uses only edges in E.
+
+Now consider the graph g' = (V, E \ {e}) (the graph with edge e removed).
+
+Since there is a path from u to v in the Eulerian circuit C that doesn't use the edge e (the path can go the "other way" around the circuit, using different edges), vertices u and v remain connected in g'.
+
+Therefore, removing edge e does not disconnect g, so e is not a bridge.
+
+**Case 2:** g is disconnected.
+
+A bridge is defined with respect to connected components. An edge e is a bridge if removing it increases the number of connected components. If e is within a connected component, the argument from Case 1 applies. If e is a cut-edge between components, we cannot have all vertices with even degree (the vertices on the boundary would need edges only to other components, making degree counting impossible in a consistent way), but more directly: removing a bridge would increase the number of components. If g is disconnected and all vertices have even degree, each connected component has all vertices with even degree, and the argument from Case 1 applies to each component.
+
+**Conclusion:** g contains no bridge. ✓
+
+---
+
+### 3.3 Edge Coloring and Hamiltonian Circuits
+
+**Claim:** If g = (V, E) has every vertex with degree 3 and contains a Hamiltonian circuit, then there exists a 3-coloring of the edges of g.
+
+**Proof:**
+
+Let H be a Hamiltonian circuit in g. The circuit H is a cycle that includes every vertex exactly once and uses 2 edges incident to each vertex.
+
+**Step 1: Color the edges in the Hamiltonian circuit.**
+
+The Hamiltonian circuit H is a cycle. For any cycle (even or odd), we can properly 2-edge-color it:
+- Assign color 1 to alternating edges in the cycle
+- Assign color 2 to the remaining edges in the cycle
+
+This ensures no two adjacent edges (edges sharing a vertex) in the cycle have the same color.
+
+**Verification:** In a cycle, at each vertex, one edge has color 1 and one edge has color 2, so they're different. ✓
+
+**Step 2: Color the remaining edges.**
+
+Since each vertex has degree 3 and the Hamiltonian circuit uses 2 edges per vertex, there is exactly 1 remaining edge incident to each vertex (not in H).
+
+Let F = E \ E(H) be the set of remaining edges. These edges form a 1-regular spanning subgraph of g (i.e., a perfect matching).
+
+**Key property of a matching:** No two edges in a matching share a vertex.
+
+**Step 3: Assign color 3 to all edges in F.**
+
+Since no two edges in the matching F share a vertex, we can safely assign color 3 to all of them without creating a conflict (two edges with the same color sharing a vertex).
+
+**Conclusion:** We have a 3-coloring of all edges: use colors {1, 2} for H (properly 2-colored) and color 3 for F. ✓
+
+---
+
+### 3.4 Cartesian Product Graphs
+
+**Definition:** The Cartesian product of two connected graphs g₁ = (V₁, E₁) and g₂ = (V₂, E₂) is C = (V_C, E_C) where:
+- V_C = V₁ × V₂
+- E_C = {{(u, x), (v, y)} : {u, v} ∈ E₁ OR {x, y} ∈ E₂}
+
+**Key observation about edges:** Two nodes (u, x) and (v, y) are adjacent in C if and only if:
+- u = v and {x, y} ∈ E₂ (edge in the g₂ direction), OR
+- x = y and {u, v} ∈ E₁ (edge in the g₁ direction)
+
+The degree of vertex (u, x) in C is: deg_C(u, x) = deg_{g₁}(u) + deg_{g₂}(x)
+
+---
+
+**Part (a): If g₁ and g₂ both contain Hamiltonian circuits, then C contains a Hamiltonian circuit.**
+
+**Claim: TRUE**
+
+**Proof:**
+
+Let H₁ = v₁, v₂, ..., v_m, v₁ be a Hamiltonian circuit in g₁ (visiting all m vertices)
+Let H₂ = x₁, x₂, ..., x_n, x₁ be a Hamiltonian circuit in g₂ (visiting all n vertices)
+
+We construct a Hamiltonian circuit in C using a "snake" pattern:
+
+**Construction:**
+1. Start at (v₁, x₁)
+2. Follow the H₂ path in the fiber {(v₁, y) : y ∈ V₂}:
+ - (v₁, x₁) → (v₁, x₂) → ... → (v₁, x_n)
+3. Move to the next fiber: (v₁, x_n) → (v₂, x_n) [using an edge from H₁]
+4. Follow H₂ in reverse in the {(v₂, y) : y ∈ V₂} fiber:
+ - (v₂, x_n) → (v₂, x_{n-1}) → ... → (v₂, x₁)
+5. Move to the next fiber: (v₂, x₁) → (v₃, x₁) [using an edge from H₁]
+6. Continue alternating: forward/reverse through each fiber, connected by edges from H₁
+7. After processing all m fibers, we return to (v₁, x₁)
+
+**Verification:**
+- We visit each (v_i, x_j) exactly once (all m × n vertices) ✓
+- Each step uses an edge in C (either within a fiber using H₂, or between fibers using H₁) ✓
+- We return to the starting vertex, forming a circuit ✓
+
+**Conclusion:** C contains a Hamiltonian circuit. ✓
+
+---
+
+**Part (b): If g₁ and g₂ both contain Euler circuits, then C contains an Euler circuit.**
+
+**Claim: TRUE**
+
+**Proof:**
+
+**Recall (Theorem 1 from Section 10.5):** A connected graph has an Euler circuit if and only if all vertices have even degree.
+
+**Given:** g₁ has an Euler circuit, so all vertices in g₁ have even degree.
+**Given:** g₂ has an Euler circuit, so all vertices in g₂ have even degree.
+
+**Claim:** All vertices in C have even degree.
+
+**Proof of claim:**
+- For any vertex (u, x) in C:
+ - deg_C(u, x) = deg_{g₁}(u) + deg_{g₂}(x)
+ - Since deg_{g₁}(u) is even and deg_{g₂}(x) is even:
+ - deg_C(u, x) = even + even = even ✓
+
+**Is C connected?**
+
+Both g₁ and g₂ are given as connected. For any two vertices (u, x) and (u', x') in C:
+- Use a path in g₁ from u to u' to move between fibers (staying in x-coordinate)
+- Use a path in g₂ from x to x' within the u'-fiber
+
+This shows C is connected. ✓
+
+**Conclusion:**
+
+By Theorem 1 (Euler's criterion):
+- C is connected ✓
+- All vertices in C have even degree ✓
+- Therefore, C has an Euler circuit ✓
+
+---
+
+## Summary
+
+All problems have been addressed:
+- **Problem 1:** Degree sequences, planarity, course prerequisites DAG analysis, and matching definitions
+- **Problem 2:** Formulations for jury selection (independent set), student groups (clique cover), and course scheduling (graph coloring)
+- **Problem 3:** Complete proofs for bipartite bit vectors, bridges and even degrees, edge coloring with Hamiltonian circuits, and Cartesian product properties
Sub-Model Usage
| Model | Input | Output | Cache Read | Cost |
|---|---|---|---|---|
| claude-haiku-4-5-20251001 | 23 | 11.4K | 78.1K | $0.10 |
BSCS Bench