Commit b98d3b0
* feat: add MinimumHittingSet → ILP reduction
Implements the MinimumHittingSet to ILP reduction with:
- Binary variables x_e per universe element
- Constraints ∀ set S: Σ_{e∈S} x_e ≥ 1
- Objective: minimize Σ x_e (unit weight)
- Direct 1:1 solution extraction
- Overhead: num_vars = universe_size, num_constraints = num_sets
Includes 4 test cases covering structure, closed-loop, extraction, and trivial instances.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add MaximalIS → ILP reduction
Implements ILP formulation for MaximalIS with independence constraints
(x_u + x_v ≤ 1 per edge) and maximality constraints (x_v + Σ_{u∈N(v)} x_u ≥ 1
per vertex), maximizing the weighted sum. Includes 6 unit tests covering
structure, BF-vs-ILP parity, solution extraction, trivial, star, weighted,
and path instances.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add PartiallyOrderedKnapsack → ILP reduction
Implements the binary ILP formulation: one variable per item, a capacity
constraint, precedence constraints (x_b ≤ x_a for each (a,b) pair), and
a Maximize objective over item values.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add KClique → ILP reduction
Binary ILP formulation: x_v per vertex, cardinality constraint Σ x_v ≥ k,
non-edge constraints x_u + x_v ≤ 1, empty objective (feasibility). Four tests
covering ILP structure, BF vs ILP parity, solution extraction, and trivial case.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add RectilinearPictureCompression → ILP reduction
Binary ILP with one variable per maximal rectangle, coverage constraints
for each 1-cell, and a bound constraint. Feasibility (Or) objective.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add ExactCoverBy3Sets → ILP reduction
Binary variable x_j per 3-element subset; equality constraints enforce
exact cover (each element covered once) plus a cardinality constraint
(universe_size/3 triples selected); empty objective for pure feasibility.
Also fix compilation errors in sibling ILP rules on this branch
(from_edges → new, missing Graph import, deref pattern fix).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: remove unused Max import from maximalis_ilp test
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add Batch 1 ILP reductions (6 rules)
MinimumHittingSet, ExactCoverBy3Sets, KClique, MaximalIS,
PartiallyOrderedKnapsack, RectilinearPictureCompression → ILP
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add MinimumFeedbackArcSet → ILP reduction
Implements MTZ-style topological ordering constraints to reduce
MinimumFeedbackArcSet<i32> to ILP<i32>: binary arc-removal variables
plus integer ordering variables, with arc-ordering, binary-bound, and
order-bound constraints. Includes 4 unit tests covering structure,
bf-vs-ilp comparison, solution extraction, and trivial DAG case.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add MultipleCopyFileAllocation → ILP reduction
Binary x_v / y_{v,u} formulation with assignment, capacity-link, and
budget constraints; BFS all-pairs distances handle unreachable pairs via
big-M; four closed-loop tests verify structure, BF-vs-ILP, extraction,
and trivial single-vertex instance.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add NAESatisfiability → ILP reduction
Implements the NAE-SAT to ILP reduction using two constraints per clause:
a lower bound (at least one true literal) and an upper bound (at least
one false literal), using the standard signed-literal encoding.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add Batch 2 ILP reductions (NAESatisfiability, SWCP, MCFA)
NAESatisfiability → ILP<bool>: binary per variable, NAE constraints
ShortestWeightConstrainedPath → ILP<i32>: directed arc + MTZ ordering
MultipleCopyFileAllocation → ILP<bool>: placement + assignment + BFS
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* style: fix rustfmt formatting in SWCP ILP test
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add MinimumSumMulticenter → ILP reduction
Implements the p-median binary ILP formulation with binary center variables
x_j, assignment variables y_{i,j}, cardinality/assignment/capacity constraints,
and a weighted-distance minimization objective using BFS all-pairs distances.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add MinMaxMulticenter → ILP reduction
Implements the vertex p-center binary ILP formulation with binary center variables
x_j, assignment variables y_{i,j}, cardinality/assignment/capacity/bound constraints,
and a feasibility objective using BFS all-pairs distances.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add MultiprocessorScheduling → ILP reduction
Binary one-hot formulation with task assignment and processor load constraints.
Includes 4 unit tests covering creation, BF vs ILP, extraction, and trivial case.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add CapacityAssignment → ILP reduction
Binary one-hot formulation with per-link assignment and global cost/delay budget constraints.
Includes 4 unit tests covering creation, BF vs ILP, extraction, and trivial case.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add ExpectedRetrievalCost → ILP reduction
One-hot assignment with McCormick linearization of the quadratic expected-cost objective.
Includes 4 unit tests covering structure, BF vs ILP, extraction, and trivial case.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add PartitionIntoTriangles → ILP reduction
One-hot group assignment with size-3 constraints and non-edge exclusion per group.
Includes 4 unit tests covering structure, BF vs ILP, extraction, and trivial case.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add PartitionIntoPathsOfLength2 → ILP reduction
One-hot assignment with McCormick-linearized edge-count constraint requiring ≥2 edges per group.
Includes 4 unit tests covering structure, BF vs ILP, extraction, and trivial case.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add SumOfSquaresPartition → ILP reduction
One-hot assignment with McCormick linearization of the quadratic sum-of-squares bound.
Includes 4 unit tests covering structure, BF vs ILP, extraction, and trivial case.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: register 6 new ILP reduction rules in mod.rs
Wire capacityassignment, expectedretrievalcost, multiprocessorscheduling,
partitionintopathsoflength2, partitionintotriangles, and sumofsquarespartition
ILP rules into the module tree and example-db registry.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add PrecedenceConstrainedScheduling → ILP reduction
Time-indexed binary ILP with one-hot per task, processor capacity, and
precedence constraints. 4 tests covering structure, closed-loop, infeasibility, and extraction.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add SchedulingWithIndividualDeadlines → ILP reduction
Time-indexed binary ILP with per-task deadline windows, processor
capacity, and precedence constraints. 4 tests covering structure,
closed-loop, infeasibility, and extraction.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add SequencingWithinIntervals → ILP reduction
Time-indexed binary ILP with per-task variable-width start windows and
pairwise non-overlap constraints between overlapping task pairs.
4 tests covering structure, closed-loop, infeasibility, and extraction.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add UndirectedTwoCommodityIntegralFlow → ILP reduction
Integer ILP with 8 variables per edge: 4 directional flow variables plus
2 binary direction indicators per commodity. Joint capacity enforced via
big-M linearization. 4 tests covering structure, closed-loop,
infeasibility, and extraction.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add DirectedTwoCommodityIntegralFlow → ILP reduction
Integer ILP with 2|A| variables (one per commodity per arc). Joint arc
capacity, flow conservation at non-terminals, and sink requirements.
4 tests covering structure, closed-loop, infeasibility, and extraction.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add UndirectedFlowLowerBounds → ILP reduction
Integer ILP with 3|E| variables: bidirectional flows plus binary
orientation indicators. Big-M constraints enforce lower and upper
capacity bounds per chosen direction. Extraction inverts orientation
indicator to match model convention. 4 tests covering structure,
closed-loop, infeasibility, and extraction.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: complete Tier 2 ILP reductions (Batches 3-6), paper stubs, and backfill tests
Add remaining 18 ILP reduction rules (Batches 3-5), backfill BF-vs-ILP
comparison tests for 4 existing rules (Batch 6), add 24 paper stubs in
reductions.typ, fix clippy warnings, canonical example consistency, and
wire all example_db entries.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix ci
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b0f2cab commit b98d3b0
57 files changed
Lines changed: 6300 additions & 41 deletions
File tree
- docs/paper
- examples
- problemreductions-cli/tests
- src
- models/graph
- rules
- unit_tests/rules
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
120 | 118 | | |
121 | 119 | | |
122 | 120 | | |
| |||
160 | 158 | | |
161 | 159 | | |
162 | 160 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 161 | + | |
168 | 162 | | |
169 | 163 | | |
170 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1519 | 1519 | | |
1520 | 1520 | | |
1521 | 1521 | | |
1522 | | - | |
| 1522 | + | |
1523 | 1523 | | |
1524 | 1524 | | |
1525 | 1525 | | |
| |||
1557 | 1557 | | |
1558 | 1558 | | |
1559 | 1559 | | |
1560 | | - | |
1561 | | - | |
1562 | | - | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
1563 | 1563 | | |
1564 | | - | |
| 1564 | + | |
1565 | 1565 | | |
1566 | | - | |
1567 | | - | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
1568 | 1572 | | |
1569 | 1573 | | |
1570 | 1574 | | |
1571 | 1575 | | |
1572 | 1576 | | |
1573 | 1577 | | |
1574 | | - | |
| 1578 | + | |
1575 | 1579 | | |
1576 | 1580 | | |
1577 | 1581 | | |
| |||
1604 | 1608 | | |
1605 | 1609 | | |
1606 | 1610 | | |
1607 | | - | |
1608 | | - | |
| 1611 | + | |
| 1612 | + | |
1609 | 1613 | | |
1610 | 1614 | | |
1611 | 1615 | | |
| |||
4422 | 4426 | | |
4423 | 4427 | | |
4424 | 4428 | | |
4425 | | - | |
| 4429 | + | |
4426 | 4430 | | |
4427 | 4431 | | |
4428 | 4432 | | |
| |||
4449 | 4453 | | |
4450 | 4454 | | |
4451 | 4455 | | |
4452 | | - | |
4453 | | - | |
4454 | | - | |
| 4456 | + | |
| 4457 | + | |
| 4458 | + | |
| 4459 | + | |
| 4460 | + | |
| 4461 | + | |
| 4462 | + | |
| 4463 | + | |
| 4464 | + | |
| 4465 | + | |
| 4466 | + | |
4455 | 4467 | | |
4456 | 4468 | | |
4457 | 4469 | | |
| |||
5644 | 5656 | | |
5645 | 5657 | | |
5646 | 5658 | | |
5647 | | - | |
| 5659 | + | |
5648 | 5660 | | |
5649 | 5661 | | |
5650 | 5662 | | |
| |||
5660 | 5672 | | |
5661 | 5673 | | |
5662 | 5674 | | |
5663 | | - | |
| 5675 | + | |
| 5676 | + | |
| 5677 | + | |
| 5678 | + | |
| 5679 | + | |
5664 | 5680 | | |
5665 | | - | |
| 5681 | + | |
5666 | 5682 | | |
5667 | | - | |
5668 | | - | |
| 5683 | + | |
| 5684 | + | |
| 5685 | + | |
| 5686 | + | |
| 5687 | + | |
| 5688 | + | |
5669 | 5689 | | |
5670 | 5690 | | |
5671 | 5691 | | |
| |||
5848 | 5868 | | |
5849 | 5869 | | |
5850 | 5870 | | |
5851 | | - | |
| 5871 | + | |
5852 | 5872 | | |
5853 | 5873 | | |
5854 | 5874 | | |
| |||
5888 | 5908 | | |
5889 | 5909 | | |
5890 | 5910 | | |
5891 | | - | |
| 5911 | + | |
5892 | 5912 | | |
5893 | 5913 | | |
5894 | 5914 | | |
| |||
6094 | 6114 | | |
6095 | 6115 | | |
6096 | 6116 | | |
6097 | | - | |
| 6117 | + | |
6098 | 6118 | | |
6099 | 6119 | | |
6100 | 6120 | | |
| |||
6143 | 6163 | | |
6144 | 6164 | | |
6145 | 6165 | | |
6146 | | - | |
| 6166 | + | |
6147 | 6167 | | |
6148 | 6168 | | |
6149 | 6169 | | |
| |||
6381 | 6401 | | |
6382 | 6402 | | |
6383 | 6403 | | |
6384 | | - | |
| 6404 | + | |
6385 | 6405 | | |
6386 | 6406 | | |
6387 | 6407 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
152 | 158 | | |
153 | 159 | | |
154 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
0 commit comments