Fix #233: [Model] StrongConnectivityAugmentation#652
Fix #233: [Model] StrongConnectivityAugmentation#652
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #652 +/- ##
==========================================
+ Coverage 96.88% 96.90% +0.01%
==========================================
Files 269 271 +2
Lines 36036 36336 +300
==========================================
+ Hits 34915 35212 +297
- Misses 1121 1124 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds the new StrongConnectivityAugmentation directed-graph satisfaction model (issue #233) and wires it into the registry, example DB, CLI (pred create), reduction-graph docs exports, and the paper.
Changes:
- Implement
StrongConnectivityAugmentationmodel (schema/variants, evaluation, example-db canonical instance) plus unit tests. - Add
DirectedGraph::is_strongly_connected()and associated topology tests. - Integrate the model across exports/fixtures/docs and add CLI creation + validation tests.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/models/graph/strong_connectivity_augmentation.rs |
New model implementation + schema/variants + canonical example-db spec |
src/models/graph/mod.rs |
Register module/export and include canonical example spec |
src/models/mod.rs |
Re-export StrongConnectivityAugmentation from models |
src/lib.rs |
Add model to the public prelude exports |
src/topology/directed_graph.rs |
Add is_strongly_connected() helper used by the model |
src/unit_tests/topology/directed_graph.rs |
Tests for is_strongly_connected() |
src/unit_tests/models/graph/strong_connectivity_augmentation.rs |
Model behavior/serialization/solver tests |
src/unit_tests/trait_consistency.rs |
Ensure the new model implements core traits correctly |
src/unit_tests/example_db.rs |
Assert canonical example is discoverable via example DB |
src/example_db/fixtures/examples.json |
Add canonical example fixture for StrongConnectivityAugmentation |
problemreductions-cli/src/cli.rs |
Add --candidate-arcs flag and help text wiring |
problemreductions-cli/src/commands/create.rs |
Implement pred create StrongConnectivityAugmentation parsing/validation |
problemreductions-cli/src/problem_name.rs |
Add create-specific resolver that prefers graph-backed variants |
problemreductions-cli/src/dispatch.rs |
Add test coverage for rejecting invalid SCA instances on load |
problemreductions-cli/tests/cli_tests.rs |
CLI tests for create + error cases |
docs/src/reductions/problem_schemas.json |
Generated schema export includes SCA |
docs/src/reductions/reduction_graph.json |
Generated reduction-graph export includes SCA node |
docs/paper/references.bib |
Add Eswaran–Tarjan reference |
docs/paper/reductions.typ |
Add paper entry + figure for SCA |
docs/plans/2026-03-16-strong-connectivity-augmentation.md |
Add implementation plan document |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| assert!(problem.evaluate(&config)); | ||
|
|
||
| let solver = BruteForce::new(); | ||
| let all_satisfying = solver.find_all_satisfying(&problem); | ||
| assert_eq!(all_satisfying.len(), 1); | ||
| assert_eq!(all_satisfying[0], config); |
| /// Returns `true` if every vertex can reach every other vertex. | ||
| pub fn is_strongly_connected(&self) -> bool { | ||
| let n = self.num_vertices(); | ||
| if n <= 1 { | ||
| return true; | ||
| } | ||
|
|
||
| fn visit( | ||
| graph: &DirectedGraph, | ||
| start: usize, | ||
| neighbors: impl Fn(&DirectedGraph, usize) -> Vec<usize>, | ||
| ) -> Vec<bool> { | ||
| let mut seen = vec![false; graph.num_vertices()]; | ||
| let mut stack = vec![start]; | ||
| seen[start] = true; | ||
|
|
||
| while let Some(v) = stack.pop() { | ||
| for u in neighbors(graph, v) { | ||
| if !seen[u] { | ||
| seen[u] = true; | ||
| stack.push(u); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| seen | ||
| } | ||
|
|
||
| let forward = visit(self, 0, DirectedGraph::successors); | ||
| if forward.iter().any(|&seen| !seen) { | ||
| return false; | ||
| } | ||
|
|
||
| let reverse = visit(self, 0, DirectedGraph::predecessors); | ||
| reverse.iter().all(|&seen| seen) | ||
| } |
| # StrongConnectivityAugmentation Implementation Plan | ||
|
|
||
| > **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. | ||
|
|
||
| **Goal:** Add the `StrongConnectivityAugmentation` model from issue #233 as a directed-graph satisfaction problem, with registry/example-db/CLI integration, paper documentation, and verification. | ||
|
|
||
| **Architecture:** Reuse the repo's existing `DirectedGraph` wrapper for the base digraph, store augmentable weighted arcs explicitly, and treat each binary variable as "add this candidate arc". Evaluation should accept exactly those configurations whose selected candidate arcs stay within the bound and make the augmented digraph strongly connected. Keep the paper/example writing in a separate batch after the model, tests, exports, and fixtures are complete. | ||
|
|
||
| **Tech Stack:** Rust workspace, `inventory` schema registry, `declare_variants!`, `DirectedGraph`, `BruteForce`, `pred create`, example-db fixtures, Typst paper, `make` verification targets. |
| # StrongConnectivityAugmentation Implementation Plan | ||
|
|
||
| > **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. | ||
|
|
||
| **Goal:** Add the `StrongConnectivityAugmentation` model from issue #233 as a directed-graph satisfaction problem, with registry/example-db/CLI integration, paper documentation, and verification. |
Review Pipeline Report
Remaining issues for final review
Generated by review-pipeline |
Summary
StrongConnectivityAugmentationsatisfaction model for issue [Model] StrongConnectivityAugmentation #233Fixes #233