When a model is solved repeatedly, the previous solution may already be valuable. In weighted Max-Cut, for example, changes to edge weights leave every binary assignment feasible as long as the graph and variable set remain fixed. The previous cut can be scored on the new objective before any search begins.

A warm start supplies that assignment to a new optimization job. Its value is best understood by separating what the previous solution already achieves from what the new search improves.

Three values rather than two

For a fixed new instance, compare the previous assignment evaluated on the new weights, a cold search and a warm search using the same search budget. The first value is the baseline for incremental improvement. For maximization, subtract it from the new warm objective to measure the improvement made after submission.

If a reference is the best cut recorded across several runs, express distances relative to that reference. A mathematical upper bound is needed to certify a Max-Cut optimality gap. With multiple seeds, compute per-run ratios before taking a median if that is the statistic you intend to report.

Supply a starting solution

The following excerpt assumes that model_yesterday and model_today describe the same variables with different edge weights. Use the developer documentation to configure the client.

import fourcolors.qubo

previous = fourcolors.qubo.solve(model_yesterday, time_limit_s=30, seed=1)
if previous.solution is None:
    raise RuntimeError("No starting solution returned")
yesterday = previous.solution

cold = fourcolors.qubo.solve(model_today, time_limit_s=2, seed=1)
warm = fourcolors.qubo.solve(model_today, time_limit_s=2, seed=1, warm_start=yesterday)

Check variable labels and order before reusing a solution. A warm start is an initial assignment for a new search, rather than a continuation of its previous internal state.

An independently checkable example

from itertools import product
old = [(0,1,4),(1,2,3),(0,2,1)]
new = [(0,1,4),(1,2,1),(0,2,5)]
score = lambda x,e: sum(w for i,j,w in e if x[i]!=x[j])
xs = list(product((0,1),repeat=3))
a = max(xs,key=lambda x:score(x,old))
b = max(xs,key=lambda x:score(x,new))
assert score(a,new)==5 and score(b,new)==9

The previous optimal cut remains feasible, but the updated objective rewards a different partition. In this illustration, reusing the previous assignment alone achieves a cut value of five; an exact search reaches nine. That difference measures the potential improvement on the new instance, independent of the algorithm used to find it.

For a cut, exchanging both side labels leaves the partition unchanged. When comparing decisions, use the smaller of the Hamming distances to the original assignment and its complement.

When continuity itself has value

A different objective can be appropriate when changing decisions carries a cost. A portfolio may incur trading costs or a plan may require operational changes. Add a suitable change cost to the model when stability matters; a warm start alone does not enforce a limit on changes.

The warm-start example repository contains the larger Max-Cut experiment and its scoring scripts. Compare cold and warm searches with the supplied assignment under the same updated objective. Retain the decoded solutions as well as the values so that changes can be checked.

Try warm starts with the 4colors Optimizer for QUBO.