Fix StrongConnectivityAugmentation canonical example#695
Merged
Conversation
The old example had 18 candidate arcs (search space 2^18 = 262,144), which is too large for a canonical example. Replace with a non-trivial 5-vertex path digraph with 9 candidate arcs (2^9 = 512) and bound B=8. All 9 arcs are individually affordable, but only the pair (4→1, w=3) + (1→0, w=5) achieves strong connectivity — alternative escape arcs from v4 land on vertices from which reaching v0 within budget is impossible. Also update the Typst paper: list all candidate arcs with weights in the description text, and fix the figure to show clear directional arrows with blue curved augmenting arcs above the path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #695 +/- ##
=======================================
Coverage 97.19% 97.19%
=======================================
Files 308 308
Lines 40386 40368 -18
=======================================
- Hits 39254 39237 -17
+ Misses 1132 1131 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Regenerate examples.json fixture after merge. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates the canonical example for the StrongConnectivityAugmentation model to a smaller, clearer instance and refreshes the paper/fixtures so the example stays consistent across code, generated JSON, and documentation.
Changes:
- Replace the prior 6-vertex / 18-candidate-arc canonical example with a 5-vertex path graph and 9 candidate arcs (with a unique satisfying solution under bound 8).
- Regenerate the example-db fixture (
examples.json) to match the updated canonical instance and configs. - Update the Typst paper narrative and diagram to reflect the new instance and visualize the chosen augmenting arcs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/models/graph/strong_connectivity_augmentation.rs |
Updates the canonical example instance (graph, candidate arcs, bound, and sample configs). |
src/example_db/fixtures/examples.json |
Updates stored fixture data to match the new canonical example. |
docs/paper/reductions.typ |
Updates the StrongConnectivityAugmentation section text and figure to match the new canonical instance. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+233
to
+234
| // Nine candidate arcs are all individually affordable, but only the | ||
| // pair (4→1, w=3) + (1→0, w=5) = 8 = B achieves strong connectivity. |
| Strong Connectivity Augmentation models network design problems where a partially connected directed communication graph may be repaired by buying additional arcs. Eswaran and Tarjan showed that the unweighted augmentation problem is solvable in linear time, while the weighted variant is substantially harder @eswarantarjan1976. The decision version recorded as ND19 in Garey and Johnson is NP-complete @garey1979. The implementation here uses one binary variable per candidate arc, so brute-force over the candidate set yields a worst-case bound of $O^*(2^m)$ where $m = "num_potential_arcs"$. #footnote[No exact algorithm improving on brute-force is claimed here for the weighted candidate-arc formulation implemented in the codebase.] | ||
|
|
||
| *Example.* The canonical instance has $n = #nv$ vertices, $|A| = #ne$ existing arcs, #candidates.len() weighted candidate arcs, and bound $B = #bound$. The base graph already contains the directed 3-cycle $v_0 -> v_1 -> v_2 -> v_0$ and the strongly connected component on ${v_3, v_4, v_5}$, with only the forward bridge $v_2 -> v_3$ between them. The unique satisfying augmentation under this bound selects the single candidate arc $(v_#arc.at(0), v_#arc.at(1)))$ of weight #arc.at(2), closing the cycle $v_2 -> v_3 -> v_4 -> v_5 -> v_2$ and making every vertex reachable from every other. The all-zero configuration is infeasible because no path returns from ${v_3, v_4, v_5}$ to ${v_0, v_1, v_2}$. | ||
| *Example.* The canonical instance has $n = #nv$ vertices, $|A| = #ne$ existing arcs, and bound $B = #bound$. The base graph is the directed path $v_0 -> v_1 -> v_2 -> v_3 -> v_4$ — every vertex can reach those ahead of it, but vertex $v_4$ is a sink with no outgoing arcs. The #candidates.len() candidate arcs with weights are: #candidates.map(a => $w(v_#(a.at(0)), v_#(a.at(1))) = #(a.at(2))$).join(", "). All are individually within budget, yet only the pair #chosen.map(a => $(v_#(a.at(0)), v_#(a.at(1)))$).join(" and ") with weights #chosen.map(a => $#(a.at(2))$).join($+$) $= #total-weight = B$ achieves strong connectivity. Alternative escape arcs from $v_4$ (to $v_3$ or $v_2$) are equally cheap but land on vertices from which reaching $v_0$ within the remaining budget is impossible. |
zazabap
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
See #233 and #652 .
Test plan
make checkpasses (fmt + clippy + tests)make papercompiles successfullymake regenerate-fixturesproduces consistent JSON🤖 Generated with Claude Code