solve_lp(problem, method="highs")using SciPy/HiGHS.- Methods:
highs,highs-ds,highs-ipm. - Optional: sensitivity via HiGHS marginals (to be exposed by
perform_sensitivity_analysis).
- Methods:
solve_knapsack_01(values, weights, capacity)baseline DP (O(n·capacity)).- Deterministic reconstruction; good for teaching & tests.
- Wrapper on OR-Tools CP-SAT for integer/boolean models (
solve_milp). - Goal: single canonical MILP schema (vars, domains, linear constraints, objective).
pre_process_lp_data: drop zero rows/cols, normalize bounds, simple scaling.- Redundant constraints detection (basic linear algebra / rank checks).
- Dual explanations (simple + detailed math).
- Algorithm steps visualization for small instances (e.g., knapsack DP table snapshots).
- Prefer robust, maintained libraries (SciPy/HiGHS, OR-Tools).
- Keep wrappers thin and inputs canonical.
- Make “fallbacks” explicit (e.g., DP for small knapsack, OR-Tools for large).