pympcc.multistart

pympcc.multistart(problem, *, n_starts=16, perturb_scale=0.1, seed=0, n_jobs=1, **solve_kwargs)[source]

Solve problem from n_starts perturbed initial points.

Parameters:
  • problem (MPCCProblem or StructuredMPCC) – Source problem. problem.x0 is the centre of the perturbation distribution and is restored on return (the function does not leave the problem mutated).

  • n_starts (int, default 16) – Number of starting points. Must be >= 1. Start 0 always uses problem.x0 verbatim, so n_starts=1 is equivalent to a plain pympcc.solve() call.

  • perturb_scale (float, default 0.1) – Standard deviation of the Gaussian perturbation applied to each coordinate, expressed as a fraction of max(|x0|, 1).

  • seed (int, default 0) – RNG seed for reproducible perturbations.

  • n_jobs (int, default 1) – Worker count for parallel execution. 1 (default) runs sequentially in-process; -1 resolves to os.cpu_count(); any other positive integer fans out across that many processes via ProcessPoolExecutor with the spawn start method. When n_jobs != 1 all problem callables must be picklable (no bare lambdas / local closures).

  • **solve_kwargs – Forwarded verbatim to pympcc.solve() (strategy, backend, ipopt_options, presolve, autoscale, strategy options, etc.).

Return type:

MultiStartResult