Skip to content

Warm starts: rebuild-over-edit is only cheap if the solve is warm #382

Description

@FBumann

Warm starts are one clause in ROADMAP Track 2c — "a related gap, which solver_direct would need to set through highspy" — with no issue behind them. That undersold it before, and a scoping decision has now made it load-bearing.

Why it got promoted

Structural editing is permanently out: remove_constraints / remove_variables / reindexing invalidate the label contract, and #82 keeps re-solve to value-only for that reason. The accepted alternative for anything structural is rebuild the model, which is defensible here in a way it would not be in an array-based layer — the build streams and costs seconds against a solve that costs minutes.

But that trade only holds if the rebuilt model does not re-solve from scratch. Rebuild-plus-cold-solve throws away the expensive half. So the decision "rebuild rather than edit" is the decision that makes warm start the thing holding it up.

What it needs

solver_direct builds a fresh highspy.Highs per solve and drops the handle, so there is nowhere to carry a basis from. #204 introduces the session that holds it; this rides on that.

  • setBasis — the LP case, the one that matters for rebuild-and-resolve and for rolling horizon
  • setSolution — the MIP case, an incumbent to bound the search
  • Reading the basis back outgetBasis, so a caller can carry it across builds themselves

The label argument is the same one that makes #82 safe: var_label is the solver column index with no remapping, so a basis is indexed by exactly the labels we already hand back. Carrying it across a rebuild is valid iff the label set is unchanged, which is decidable off the resolved AST by the check #82 already ships — a parameter read by a where changes which rows survive and invalidates it; a changed group_sum mapping leaves labels alone but rewrites A, which invalidates a basis while leaving a MIP start usable.

That distinction is worth getting right rather than refusing both cases together.

Scope

Out: automatic basis reuse. The caller says when a warm start applies, or the #82 check says it is safe; the engine does not guess. Guessing wrong is a silently wrong answer in the time dimension, not the value one, which makes it hard to notice.

Blocked on #204.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:engineLowering, IR, relational executor, the sink contractarea:solverSolver sink, options, statuses, duals, value read-backfeatureNew capabilityperfWall time, memory, or I/O cost — not a wrong answer

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions