Conversation
isPANN
added this pull request to stack #1181
September 28, 2026 06:27
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## fix/flow-ilp-overhead #1183 +/- ##
=======================================================
Coverage 96.77% 96.77%
=======================================================
Files 1072 1072
Lines 140628 140741 +113
=======================================================
+ Hits 136086 136199 +113
Misses 4542 4542 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Motivation
This PR restores QUBO size predictions for
BiconnectivityAugmentationandStrongConnectivityAugmentation, including paths that start atHamiltonianCircuit. It adds one computed source parameter to each augmentation model and supplies the missing formulas on their incoming and outgoing reduction rules.What is currently missing?
The reduction graph should predict the size of a reduced problem from the source instance's parameters, before constructing intermediate problems. On the base branch, both augmentation →
ILP<bool>rules can predict the number of ILP variables and constraints, but leavemax_constraint_magnitude_bitsunavailable. As a result, the existing paths below have unavailable predictions for both QUBO variables and quadratic terms:The same gap affects paths starting directly at either augmentation model.
Why do weights and the budget affect target size?
Both reductions copy candidate weights and the budget into an ILP constraint of the form
sum(weight[j] * selected[j]) <= budget. The subsequent ILP → QUBO reduction encodes inequality slack using extra Boolean variables. The number of these variables depends on the magnitudes of the coefficients and right-hand sides, as well as the ILP's structural size. Its existing bound isN + M * (N + H), whereNis the ILP variable count,Mis its constraint count, andHis its maximum constraint magnitude in bits.Vertex, edge, and candidate counts do not describe those numeric magnitudes: the same graph and candidate set can carry different weights and budgets. The augmentation models therefore need a numeric source parameter to supply an input-dependent bound for
H. Measuring the constructed ILP would not provide a prediction from source parameters alone.Why one parameter, and why update the incoming rules?
A single intrinsic statistic,
max_numeric_magnitude_bits, covers every candidate weight and the budget. It is computed from existing input data. Separate weight and budget parameters are unnecessary because the outgoing rule only needs their maximum magnitude. This statistic is exactly the target ILP'smax_constraint_magnitude_bits, so the existing ILP → QUBO formulas can then compose.Adding the statistic only to the augmentation models would still leave paths starting at
HamiltonianCircuitincomplete. This PR also gives each incoming rule an explicit bound for that new target parameter:num_vertices + 1. Every formula remains local to its reduction and uses only that rule's source parameters.Stacked on #1182; the comparison base is
fix/flow-ilp-overhead.Changes
max_numeric_magnitude_bitsto both augmentation models: the smallesth >= 1bounding the magnitudes of every candidate weight and the budget strictly by2^h. Reuse the existing magnitude helper, including its handling ofi64::MIN.ILP.max_constraint_magnitude_bits = max_numeric_magnitude_bits. The budget row copies these values; all other coefficients, right-hand sides, and Boolean endpoints have magnitude at most one.max_numeric_magnitude_bits <= num_vertices + 1on both incoming HamiltonianCircuit rules. Their weights are 1 or 2 and budget is the source vertex count; small inputs produce fixed infeasible instances with budget zero.This adds one canonical parameter per model, with no new constructor inputs. The statistic includes the budget, avoiding both a separate budget parameter and normalization code. Reduction constructions, accepted signed biconnectivity inputs, variants, and witness mappings are unchanged. Every formula uses only its rule's source parameters.
Verified examples
Previously, both QUBO fields were unavailable on each direct augmentation → ILP → QUBO route. CLI checks now produce sound upper bounds and recover valid source witnesses:
Or(true)Or(true)The bounds deliberately remain coarse. Incomplete direct integer-coefficient ILP contracts decrease from 22 to 20; this is not a count of every possible graph path.
Validation
Three regression tests were observed failing before implementation and passing afterward:
Checks:
make paper: passed.Extreme-value tests verify metadata and ILP construction, not numerical solvability of every extreme instance by the backend.