Skip to content

Fix #230: Add BiconnectivityAugmentation model#640

Open
zazabap wants to merge 5 commits intomainfrom
issue-230-biconnectivity-augmentation
Open

Fix #230: Add BiconnectivityAugmentation model#640
zazabap wants to merge 5 commits intomainfrom
issue-230-biconnectivity-augmentation

Conversation

@zazabap
Copy link
Collaborator

@zazabap zazabap commented Mar 13, 2026

Summary

Add the BiconnectivityAugmentation problem model — a satisfaction problem (Metric = bool) from Garey & Johnson (A2 ND18). Given an undirected graph with weighted potential edges and a budget B, determine if a subset of edges with total weight <= B can be added to make the graph biconnected.

Fixes #230

@codecov
Copy link

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.77%. Comparing base (88254a0) to head (6a28edf).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #640   +/-   ##
=======================================
  Coverage   96.77%   96.77%           
=======================================
  Files         226      226           
  Lines       29919    29919           
=======================================
  Hits        28955    28955           
  Misses        964      964           

☔ 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.

@GiggleLiu
Copy link
Contributor

Implementation Summary

Changes

  • Added the BiconnectivityAugmentation satisfaction model with constructor validation, brute-force-ready evaluation, and biconnectivity checking.
  • Registered the model across exports and CLI support, including pred create, load/serialize dispatch, and --num-vertices handling for graphs with isolated vertices.
  • Added model, trait, integration, and CLI regression tests; updated the paper entry and regenerated schema / reduction-graph exports.

Deviations from Plan

  • Corrected the worked example from issue [Model] BiconnectivityAugmentation #230. With candidate edge (0,5) present at weight 2, the stated B = 3 negative case is false, so the paper/test example omits that edge to preserve the intended yes/no contrast.
  • Tightened validation beyond the initial plan by rejecting duplicate candidate edges and candidate edges that already exist in the input graph.

Open Questions

  • None.

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 BiconnectivityAugmentation satisfaction problem model (weighted candidate edges + budget) to the library, wires it into the public API and CLI, and updates generated docs/metadata accordingly.

Changes:

  • Introduces BiconnectivityAugmentation<G, W> model with evaluation via biconnectivity (articulation-point) check.
  • Integrates the model across exports (models, prelude), CLI alias/dispatch/create flow, and adds unit/integration/CLI tests.
  • Regenerates documentation artifacts (problem_schemas.json, reduction_graph.json) and updates the paper’s problem definitions.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/models/graph/biconnectivity_augmentation.rs New model implementation + schema inventory entry + variants + internal biconnectivity check
src/models/graph/mod.rs Registers/re-exports the new graph model
src/models/mod.rs Re-exports the new model at the top-level models module
src/lib.rs Exposes the model via prelude
tests/suites/integration.rs Adds end-to-end solvability integration test for the new model
src/unit_tests/trait_consistency.rs Adds trait consistency coverage for the new model
src/unit_tests/models/graph/biconnectivity_augmentation.rs Adds focused unit tests for creation/evaluation/serialization/solver behavior
problemreductions-cli/src/problem_name.rs Adds CLI alias resolution for the new problem
problemreductions-cli/src/dispatch.rs Adds CLI load/serialize dispatch support + tests
problemreductions-cli/src/commands/create.rs Adds pred create support for potential edges + budget; updates graph parsing for optional --num-vertices; adds tests
problemreductions-cli/src/cli.rs Adds CLI flags --potential-edges and --budget, and help text/examples
docs/src/reductions/problem_schemas.json Updates generated problem schema metadata
docs/src/reductions/reduction_graph.json Updates generated reduction graph metadata
docs/paper/reductions.typ Adds paper definition/description for BiconnectivityAugmentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1321 to +1327
let output_path = std::env::temp_dir().join("pred_test_create_biconnectivity.json");
let out = OutputConfig {
output: Some(output_path.clone()),
quiet: true,
json: false,
auto_json: false,
};
Comment on lines +1351 to +1358
let output_path =
std::env::temp_dir().join("pred_test_create_biconnectivity_isolated.json");
let out = OutputConfig {
output: Some(output_path.clone()),
quiet: true,
json: false,
auto_json: false,
};
Comment on lines +401 to +413
let data = json!({
"graph": {
"inner": {
"nodes": [null, null, null, null],
"node_holes": [],
"edge_property": "undirected",
"edges": [[0, 1, null], [1, 2, null], [2, 3, null]]
}
},
"potential_weights": [[0, 2, 3], [0, 3, 4], [1, 3, 2]],
"budget": 5
});

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] BiconnectivityAugmentation

3 participants