sdom.get_default_solver_config_dict#

sdom.get_default_solver_config_dict(solver_name='cbc', executable_path='.\\Solver\\bin\\cbc.exe', *, mip_gap=0.002, time_limit=None, stream_solver_output=False)[source]#

Generate a default solver configuration dictionary with standard SDOM settings.

Creates a pre-configured dictionary for solver initialization with recommended settings for SDOM optimization problems. Includes solver options and solve keywords for controlling optimization behavior.

Parameters:
  • solver_name (str, optional) –

    Solver to use. Supported values:

    • ’cbc’: COIN-OR CBC open-source MILP solver (requires executable_path)

    • ’highs’: HiGHS open-source MILP solver (uses appsi interface)

    • ’xpress’: FICO Xpress commercial solver (requires license)

    Default is ‘cbc’.

  • executable_path (str, optional) – Path to solver executable file. Required for CBC solver. Default is ‘.Solverbincbc.exe’.

  • mip_gap (float, optional) – MIP relative optimality gap tolerance. Default is 0.002 (0.2%).

  • time_limit (float, optional) – Maximum solve time in seconds. Default is None (no limit).

  • stream_solver_output (bool, optional) – Whether to stream solver native output live to stdout via tee. Default is False.

Returns:

Configuration dictionary with keys:

  • ’solver_name’ (str): Solver identifier for SolverFactory

  • ’executable_path’ (str): Path to executable (CBC only)

  • ’options’ (dict): Solver-specific options

  • ’solve_keywords’ (dict): Arguments for solver.solve() call

Return type:

dict

Notes

Solver-specific option mappings:

  • HiGHS: Uses ‘mip_rel_gap’ for MIP gap

  • Xpress: Uses ‘miprelstop’ for MIP gap, ‘maxtime’ for time limit

  • CBC: Uses ‘ratioGap’ for MIP gap

Examples

>>> # Using HiGHS (open-source)
>>> config = get_default_solver_config_dict(solver_name="highs")
>>> solver = configure_solver(config)
>>> # Using Xpress (commercial, requires license)
>>> config = get_default_solver_config_dict(
...     solver_name="xpress",
...     mip_gap=0.001,
...     time_limit=3600,
... )
>>> solver = configure_solver(config)