Quiz: spanning trees, single linkage and FH
Before this unit: The random walker (previous unit); Day 27: Graph cuts; Day 15: Watershed.
See also: Day 28: Ising model and Markov random fields; Day 35: Gaussian mixtures.
Short questions to test your understanding. Try each on paper first, then open the answer. Edge weights are dissimilarities d_{pq} (small = similar).
Q1. In Kruskal’s algorithm, how do you decide quickly whether an edge would close a cycle?
Think of the labelling unit.
An edge closes a cycle exactly when both its ends are already in the same component. Union–find answers “same component?” with two find operations in almost constant time, and union merges the components when the edge is taken.
Q2. Single linkage at threshold t can be described in three ways. Give two of them.
Edges, tree, paths.
- The connected components of the graph that keeps only edges with d < t. (2) The minimum spanning tree with all its edges \ge t removed. (3) Two pixels are in the same region iff some path between them has all edges below t (their minimax distance is below t).
Q3. Why does single linkage join a dark region and a bright region connected by a smooth ramp?
What does single linkage look at along a path?
Along the ramp every neighbour difference is small, below t. Single linkage only asks whether some path has all steps below t (the weakest link), not how much the grey level changes in total. This is called chaining.
Q4. What is the internal difference \mathrm{Int}(C) of a component in FH, and why does it help with texture?
The heaviest edge of something.
The largest edge weight in the component’s spanning tree (the biggest step it has already accepted inside). A textured region has a large Int, so FH accepts large steps into it; a flat region has a small Int and refuses even a faint step. The merge threshold adapts to each region.
Q5. A component has \mathrm{Int}(C) = 3 and 40 pixels, k = 200. Its neighbour is large and flat with threshold 2.1. Will they merge across an edge of weight 4?
Both thresholds must accept the edge.
The first threshold is 3 + 200/40 = 8, but the neighbour’s is 2.1. The test needs d \le \min(8, 2.1) = 2.1; 4 > 2.1, so they stay apart.
Q6. You set k very large, hoping to remove small regions. Small bright spots remain. Why?
Whose threshold blocks the merge?
A spot’s own threshold k/|C| is huge, but the large background around it has a small k/|C| and a small Int. The merge needs both thresholds to accept the edge, and the spot’s strong edge exceeds the background’s. k sets a scale, not a minimum size; use a separate minimum-size pass.
Q7. FH merges two bright objects separated by a dark line that has a gap of a few pixels. Why can’t a larger or smaller k fix this?
Which edge between the two objects does the test look at?
Through the gap, bright pixels of the two objects are direct neighbours with a tiny difference. The test uses the cheapest edge between the two components, and that edge is below any threshold. Only a boundary measure that looks at more than one edge (e.g. region statistics, in the merge-trees unit) can see the line.
Q8. Why is FH fast enough to be interactive on a 256 \times 256 image?
What depends on k and what does not?
The expensive part is sorting the edges (a few hundred thousand), which does not depend on k. The merge pass is one sweep over the sorted edges with union–find, nearly linear. Sort once, then re-run the pass for every new k: a few milliseconds.
Q9. (math) State the cut property of minimum spanning trees and explain how it shows that Kruskal’s algorithm is correct.
An exchange argument.
For any split of the nodes into two sets, the cheapest edge across the split belongs to some minimum spanning tree (if an MST misses it, add it, remove another edge of the resulting cycle that crosses the split: not lighter, so the new tree is no heavier). Kruskal adds an edge only when it joins two components; it is then the cheapest edge leaving either component (all cheaper ones were already processed), so every edge it adds is safe.