Summary
Add an optional Integer Linear Programming (ILP) solver using HiGHS via the good_lp crate. This would enable exact solving of problems for small-medium instances and help verify reduction correctness.
Motivation
- BruteForce solver is exponential and only works for tiny instances
- ILP solvers can handle much larger instances efficiently
- Useful for testing and verification of reductions
Proposed Implementation
Dependencies
[features]
ilp = ["good_lp"]
[dependencies]
good_lp = { version = "1.8", features = ["highs"], optional = true }
Solver API
#[cfg(feature = "ilp")]
pub struct ILPSolver {
time_limit: Option<f64>,
}
impl Solver for ILPSolver {
fn find_best<P: Problem>(&self, problem: &P) -> Vec<Vec<usize>>;
}
Problem-specific formulations
Each problem type would need an ILP formulation:
| Problem |
Formulation |
| IndependentSet |
max Σ wᵢxᵢ s.t. xᵤ + xᵥ ≤ 1 ∀(u,v)∈E |
| VertexCovering |
min Σ wᵢxᵢ s.t. xᵤ + xᵥ ≥ 1 ∀(u,v)∈E |
| SetPacking |
max Σ wᵢxᵢ s.t. Σ xⱼ ≤ 1 ∀ overlapping sets |
| MaxCut |
max Σ wᵢⱼ(xᵤ + xᵥ - 2xᵤxᵥ) (linearized) |
| SAT |
feasibility: Σ literals ≥ 1 per clause |
Options
- Trait-based: Add
ToILP trait that problems implement
- Generic: Use CSP constraints/objectives to generate ILP automatically
- Specific: Implement ILP formulation per problem type
Tasks
References
Summary
Add an optional Integer Linear Programming (ILP) solver using HiGHS via the
good_lpcrate. This would enable exact solving of problems for small-medium instances and help verify reduction correctness.Motivation
Proposed Implementation
Dependencies
Solver API
Problem-specific formulations
Each problem type would need an ILP formulation:
Options
ToILPtrait that problems implementTasks
good_lpwithhighsfeature as optional dependencyILPSolverstruct with configuration optionsReferences