You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Address three review nits on commit 1826867:
1. Canonical example richness: swap the path P4 canonical example for a
"T-tree" on 5 vertices (spider v0-v1-v2-v3 with extra leaf v1-v4),
which exposes two strictly suboptimal maximal matchings besides the
minimum (mm = 1 vs. two size-2 maximal matchings), comfortably
passing the >=2-suboptimals rule-of-thumb. Update the canonical
builder, the paper worked example, and the closed-loop test to match.
2. extract_solution: replace the per-call HashMap rebuild with a single
pass over source_edges that checks whether each edge's endpoints
share a color. For bipartite G all color classes have size <= 2,
so this is equivalent and avoids any auxiliary allocation.
3. Unit test imports: drop the catch-all "use super::*" in favour of an
explicit "use" list mirroring the MVC->MIS reference test.
cargo test rules::minimummaximalmatching_maximumachromaticnumber: 5
passed (closed-loop, complement structure, known coloring, suboptimal
recovery, identity); make paper builds cleanly.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
example-caption: [Path $P_4$ as a bipartite graph with $A = {v_0, v_2}$, $B = {v_1, v_3}$.],
14432
+
example-caption: [T-tree on $5$ vertices (spider with three legs at $v_1$): $v_0 - v_1 - v_2 - v_3$ plus the leaf $v_1 - v_4$, encoded as bipartite with $A = {v_0, v_2, v_4}$, $B = {v_1, v_3}$.],
14433
14433
extra: [
14434
14434
#{
14435
14435
let source-edges = mmm_ach.target.instance.graph.edges
@@ -14448,15 +14448,15 @@ The following reductions to Integer Linear Programming are straightforward formu
*Step 1 -- Source instance.* Path $P_4$ encoded as a bipartite graph with bipartition $A = {v_0, v_2}$ and $B = {v_1, v_3}$. In unified indices the vertex set is ${0, 1, 2, 3}$ (left vertices first), $n = #n-source$, and the $m = #m-source$ edges are #source-edges.map(e => $(#e.at(0), #e.at(1))$).join(", ").
14451
+
*Step 1 -- Source instance.* The T-tree on $5$ vertices is the spider graph with centre $v_1$ and legs to $v_0$, $v_2$, $v_4$, plus the pendant edge $v_2 - v_3$. It is bipartite with $A = {v_0, v_2, v_4}$ and $B = {v_1, v_3}$. In unified indices the vertex set is ${0, 1, 2, 3, 4}$ (left vertices first, mapping $v_0 mapsto 0$, $v_2 mapsto 1$, $v_4 mapsto 2$, $v_1 mapsto 3$, $v_3 mapsto 4$), so $n = #n-source$ and the $m = #m-source$ edges are #source-edges.map(e => $(#e.at(0), #e.at(1))$).join(", ").
14452
14452
14453
-
*Step 2 -- Complement graph $H = overline(G)$.* The non-edges of $G$ in $K_4$ give the target edge set, with $|E(H)| = #m-target$ edges (#mmm_ach.target.instance.graph.edges.map(e => $(#e.at(0), #e.at(1))$).join(", ")). The decision threshold transforms as $K' = n - K$.
14453
+
*Step 2 -- Complement graph $H = overline(G)$.* The non-edges of $G$ in $K_5$ give the target edge set, with $|E(H)| = #m-target$ edges (#mmm_ach.target.instance.graph.edges.map(e => $(#e.at(0), #e.at(1))$).join(", ")). The decision threshold transforms as $K' = n - K$.
14454
14454
14455
-
*Step 3 -- Source optimum.* The minimum maximal matching uses the middle edge, so $"mm"(G) = #matched.len() = 1$ (source index $#matched.at(0)$).
14455
+
*Step 3 -- Source optimum.* The minimum maximal matching uses the central edge $(v_1, v_2)$, so $"mm"(G) = #matched.len() = 1$ (source index $#matched.at(0)$). The T-tree also admits two strictly larger maximal matchings $\{(v_0, v_1), (v_2, v_3)\}$ and $\{(v_1, v_4), (v_2, v_3)\}$, both of size $2$ -- this richness is the reason for choosing the T-tree over the path $P_4$ as the canonical example.
14456
14456
14457
14457
*Step 4 -- Target optimum.* The achromatic coloring stored in the fixture is $#color-of.map(str).join(", ")$. The size-$2$ color class corresponds to the source edge selected in Step 3, and the singletons contribute the remaining $n - 2$ classes, so the achromatic number is $psi(H) = n - "mm"(G) = #n-source - 1 = #(n-source - 1) #sym.checkmark$.
14458
14458
14459
-
*Multiplicity:* The fixture stores one canonical witness; other valid achromatic $3$-colorings exist and would extract to other minimum maximal matchings.
14459
+
*Multiplicity:* The fixture stores one canonical witness; other valid achromatic $4$-colorings exist and would extract to the same minimum maximal matching after relabelling colors.
0 commit comments