Skip to content

Fix #233: [Model] StrongConnectivityAugmentation#652

Open
GiggleLiu wants to merge 10 commits intomainfrom
issue-233-strong-connectivity-augmentation
Open

Fix #233: [Model] StrongConnectivityAugmentation#652
GiggleLiu wants to merge 10 commits intomainfrom
issue-233-strong-connectivity-augmentation

Conversation

@GiggleLiu
Copy link
Contributor

@GiggleLiu GiggleLiu commented Mar 15, 2026

Summary

  • Add the StrongConnectivityAugmentation satisfaction model for issue [Model] StrongConnectivityAugmentation #233
  • Integrate the model across the registry, example DB, CLI creation flow, exports, tests, and paper/docs
  • Include follow-up review cleanups on the strong-connectivity helper and test/runtime polish

Fixes #233

@codecov
Copy link

codecov bot commented Mar 15, 2026

Codecov Report

❌ Patch coverage is 99.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.90%. Comparing base (bacaccd) to head (93a6dd4).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...c/models/graph/strong_connectivity_augmentation.rs 97.94% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 StrongConnectivityAugmentation model (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.

Comment on lines +138 to +143
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);
Comment on lines +146 to +181
/// 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)
}
Comment on lines +1 to +9
# 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.
Comment on lines +1 to +5
# 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.
@GiggleLiu
Copy link
Contributor Author

Review Pipeline Report

Check Result
Copilot comments 4 fixed
Issue/human comments 2 checked, 0 changes needed
Structural review manual pass (completeness pass; whitelist check was a stale tooling false positive)
CI green
Agentic test passed after doc fixes
Needs human decision none
Board Review pool -> Under review -> Final review

Remaining issues for final review

  • None.

Generated by review-pipeline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Model] StrongConnectivityAugmentation

2 participants