Data Structures & AlgorithmsVery hardICPC regional · graph counting
Problem: Which theorem counts the spanning trees of a graph as a determinant of a reduced Laplacian matrix?
- A. Hall's marriage theorem
- B. Dilworth's theorem
- C. Euler's formula
- D. Kirchhoff's matrix-tree theorem
Correct answer: D. Kirchhoff's matrix-tree theorem
Deleting one row and column of the Laplacian gives a determinant equal to the number of spanning trees, which is Kirchhoff's matrix-tree theorem.
More Coding Interview Problems questions
- Problem: An undirected graph has edges 0-1, 0-2, 1-3, 2-3, 3-4, 4-5, 2-5 (7 edges, 6 vertices 0–5). How many distinct shortest paths (by…
- Problem: A directed graph on 6 vertices (0–5) has arcs 0→1, 1→2, 0→3, 3→2, 2→4. How many ordered pairs (u, v) with u ≠ v have v…
- Problem: An undirected graph has 8 vertices and 11 edges with exactly 2 connected components. What is the minimum number of edges that…
- Problem: For the path graph P5 on vertices 1–5 (edges 1-2, 2-3, 3-4, 4-5), what is the sum of the distances over all unordered pairs of…
- Problem: The string "abcdabcd" is examined for windows of length 4 with all four characters distinct. How many such windows are there?
- Problem: What is the minimum number of characters to delete from "programming" so that all remaining characters are distinct (keep one…