Skip to content

Release 0.6.3

Choose a tag to compare

@StevenBtw StevenBtw released this 06 Oct 16:28
· 29 commits to main since this release
16e2453

[0.6.3] - 2026-10-06

Added

  • LP/MILP input: solve_lp and solve_milp accept sparse rows ({column: coefficient} dicts, mixable with dense rows), per-row senses ("<=", ">=", "=") and variable bounds lb/ub. solve_milp adds binary= (0/1 variables) and integers becomes optional. The 0.6.2 call form is unchanged.
  • Incremental MILP: MilpModel adds rows and re-solves warm (lazy cuts, objective locks, new objectives); solve_lexicographic optimizes objectives in priority order on a model (a 270-variable, 4-stage downstream model: 7.4 ms). Adding a cut to a 540-variable model and re-solving takes 13% of a fresh solve.

Fixed

  • Deep graphs: articulation_points, bridges and strongly_connected_components no longer raise RecursionError when the DFS goes deeper than Python's recursion limit (about 1,000 nodes on one path; code dependency graphs reach that easily). All three now use an iterative DFS with the same results, result order and iteration counts; a 100,000-node path or tree takes under 0.3 s. The SCC docstring's advice to raise the recursion limit is removed.
  • Rust SCC crash: strongly_connected_components_edges with the Rust backend (the default) no longer kills the Python process with a native stack overflow on deep graphs (a 100,000-node chain did). The Rust implementation is now iterative; results are identical to the Python backend, component order included.
  • Version: solvor.__version__ reported 0.6.1 in the 0.6.2 release. It now reads the installed package metadata, and the version lives only in rust/Cargo.toml.
  • Determinism: louvain and pagerank no longer depend on set iteration order: with mutually comparable nodes (ints, strs, tuples) the same graph gives the same result under any PYTHONHASHSEED, also when neighbors returns values that are not nodes (they are ignored). Result lists and dicts follow sorted node order.
  • PageRank: max_iter=0, a tol that is not positive and finite, and damping outside [0, 1) now raise ValueError on both backends (the Python path crashed or misbehaved). pagerank_edges(backend="python") ignores out-of-range edges like the Rust backend instead of raising IndexError, and the Rust backend now also ignores edges with negative endpoints or endpoints beyond 64 bits (it raised OverflowError). A negative n_nodes raises ValueError on both backends.
  • Badly scaled MILPs (big-M): solve_milp and MilpModel could return a point that violates a constraint, a worse objective than the optimum, or no solution for a feasible model when big-M coefficients of about 1e5 and up sit next to coefficients near 1 (0.6.2 too). The LP relaxations now use their own 1e-9 tolerance, rows and columns whose coefficients differ by a factor of 256 or more are scaled by powers of two, every integer solution is checked against all rows after it is snapped to integers, a warm-started "infeasible" verdict in such a model is confirmed with a fresh LP, and branching can no longer repeat a node. On 2,000 solves of random binary models with coefficients from 0.1 to 9e6, 0.6.2 returned 131 points that violate a row, 67 worse objectives and 115 "no solution" answers for feasible models, all without a warning; 0.6.3 returns 0, 2 and 4, each with the reason in error and none marked OPTIMAL.
  • Small costs next to big-M rows: in a badly scaled model the LP behind solve_lp, solve_milp and MilpModel could stop short of its optimum when a reduced cost below eps hid a large gain (the slack of a row with a large coefficient costs almost nothing per unit but can move very far). With a good warm_start, branch and bound then pruned the root and returned that warm start as OPTIMAL. Such a column now enters when its step gains more than eps * (1 + |objective|); well-scaled models keep the plain test. On 800 random LPs with costs down to 1e-5 next to coefficients up to 9e6, answers worse than HiGHS dropped from 14 to 1 (0.6.2 had this too).

Result changes

Every change in solver output is listed here, float-level ones included, so downstream caches know which upgrade invalidates them.

  • Louvain now runs both phases. Earlier releases only ran local moving and never aggregated communities, although the docs described both phases. Results change: fewer, larger communities with higher modularity (a 1,000-node path: 500 pairs at 0.50 before, above 0.9 now; a 9,091-node code graph: 1,821 communities at 0.587 before, 115 at 0.823 now). Nodes and neighbors are now processed in sorted order, so even the first level only matches earlier releases for inputs that were already sorted. If you store community labels, expect them to change. result.iterations now counts local-moving passes over all levels. Community list order is now by smallest member.
  • PageRank, Rust backend: scores change at the float level (now bit-identical to the Python backend; it used an L1 convergence test before, so it ran more iterations). Rust pagerank_edges now reports objective = the last iteration's largest score change and evaluations = the number of nodes (it returned 0.0 and 0).
  • PageRank, Python backend: scores change in their last few bits (up to about 4 ulp: it multiplies by the reciprocal of the out-degree instead of dividing); iteration counts are unchanged.
  • Result order: louvain and pagerank list and dict entries now follow sorted node order (for mutually comparable nodes) instead of input order.
  • LP/MILP: optimal objectives are unchanged (a 300-instance snapshot from 0.6.2 is part of the test suite), but where several optimal solutions exist solve_lp and solve_milp may return a different one than 0.6.2 (new LP engine and presolve).
  • Unbounded LP: solve_lp reports an objective of -inf (minimize) or inf (maximize) instead of the last vertex's value (solve_milp already did).
  • Infeasible LP when maximizing: solve_lp reports an objective of -inf (it reported inf for both directions); minimizing still gives inf.
  • Iteration limit before a feasible point: solve_lp reports MAX_ITER (it reported INFEASIBLE), with no solution; solve_milp returns MAX_ITER when the root LP hits the limit instead of branching on an unfinished LP, and when max_nodes stops the search before any solution is found (it reported INFEASIBLE, which nothing had proven).
  • LP iteration counts include bound flips (a variable jumping between its bounds without a pivot).
  • MILP solutions: integer variables are exactly integral (1.0, not 0.9999999999999998) and the objective is recomputed from them, so objectives like 79.00000000000007 become 79.0. With solution_limit > 1, result.solutions is now also set when the root LP is already integral (it was None).
  • MILP tie-breaking: the new search order (depth-first dives) can return a different optimal solution than before where several optima tie; objectives are unchanged.
  • Badly scaled LPs and MILPs: solve_lp, solve_milp and MilpModel now scale every row and column whose nonzero coefficients differ by a factor of 256 or more (binary exponents 8 or more apart). Such models can get a different solution, objective, status, iterations and evaluations, usually a correct answer where 0.6.2 was wrong. When branch and bound meets a node whose LP solution is visibly inaccurate (outside its bounds, or integral but violating a row), the result is FEASIBLE instead of OPTIMAL (or INFEASIBLE), with the reason in error. Models without such a row or column are not scaled; in every comparison we ran (the golden digests, which now include node and LP iteration counts, and random well-scaled LP and MILP families) their results are bit-identical to those without this change.
  • MILP rounding heuristic: its flip phase no longer turns off a variable with a negative cost when minimizing (or turns on one with a negative cost when maximizing), which made the first incumbent worse. Incumbents, node counts and, where optima tie, the returned solution can change.
  • MILP counts: iterations (nodes explored) and evaluations (LP iterations, now including bound flips and warm-started dual pivots) change with the new presolve and search, usually to much smaller values.

Changed

  • PageRank speed: the callback pagerank now runs on the Rust backend when installed (9,091 nodes, 33,580 arcs: 345 ms to 12 ms; the pure Python path also dropped to 183 ms). New backend keyword. The Rust and Python backends now return bit-identical scores and iteration counts (same max-norm convergence test, same compensated summation), so results do not depend on whether the Rust wheel is installed.
  • Wheels: one abi3 wheel per platform (CPython 3.12+) built with pyo3 0.29, instead of one wheel per Python version.
  • Rust toolchain: pinned to 1.99.0 for development and CI (rust-toolchain.toml); building from the sdist needs Rust 1.88 or newer. CI now runs rustfmt, clippy (warnings are errors), cargo test and a 1.88 build check.
  • LP engine: bounded-variable simplex. Bounds no longer become rows, so binary models no longer need identity rows and branch-and-bound nodes no longer add bound rows (540 binary variables: root LP 108 ms to 11 ms).
  • MILP presolve: single-variable rows become bounds; rows with only integer variables and integer coefficients are divided by their gcd and get an integral right-hand side. Lexicographic lock rows with a +0.5 slack now solve at or near the root (a 270-variable model: 83.5 s and 1,391 nodes to 0.01 s and 3 nodes; 20 recorded calls from a downstream project: 105.6 s to 0.05 s, same objectives).
  • MILP heuristics: the rounding heuristic updates row activities incrementally instead of re-checking every row after every move (a 540-variable model spent 174 s there).
  • Validation runs once per call instead of in every branch-and-bound node.
  • LP/MILP input: an empty A is accepted (only bounds), rows with an infinite right-hand side are dropped when they can never bind and make the model infeasible when they can never hold. A lower bound of +inf, an upper bound of -inf, an infinite cost or constraint coefficient, or an eps that is negative, NaN or infinite raises ValueError (a negative eps crashed with ZeroDivisionError; the others returned OPTIMAL with a NaN objective, a violated row or a wrong point).
  • MILP branch and bound re-solves each node with the dual simplex from its parent's basis and dives depth-first before taking the best queued node (7 branching benchmarks: 8.6 s to 2 s, 5 to 14 times fewer LP pivots).
  • LP/MILP Rust kernel: the simplex tableau behind solve_lp, solve_milp and MilpModel runs in Rust when the extension is installed (new backend keyword, "auto" by default). It performs the same float operations in the same order as the Python kernel, so results are bit-identical on either backend; branch and bound, presolve and heuristics stay in Python. 13 branching benchmarks run about 60 times faster in total, the root LP of a 540-variable packing model about 75 times faster.

What's Changed

Full Changelog: v0.6.2...v0.6.3