HiGHS
- class pyomo.contrib.appsi.solvers.highs.Highs(only_child_vars=False)[source]
Bases:
PersistentBase
,PersistentSolver
Interface to HiGHS
- enum Availability(value)
Bases:
IntEnum
An enumeration.
- Member Type:
Valid values are as follows:
- NotFound = <Availability.NotFound: 0>
- BadVersion = <Availability.BadVersion: -1>
- BadLicense = <Availability.BadLicense: -2>
- FullLicense = <Availability.FullLicense: 1>
- LimitedLicense = <Availability.LimitedLicense: 2>
- NeedsCompiledExtension = <Availability.NeedsCompiledExtension: -3>
- add_block(block)
- available()[source]
Test if the solver is available on this system.
Nominally, this will return True if the solver interface is valid and can be used to solve problems and False if it cannot.
Note that for licensed solvers there are a number of “levels” of available: depending on the license, the solver may be available with limitations on problem size or runtime (e.g., ‘demo’ vs. ‘community’ vs. ‘full’). In these cases, the solver may return a subclass of enum.IntEnum, with members that resolve to True if the solver is available (possibly with limitations). The Enum may also have multiple members that all resolve to False indicating the reason why the interface is not available (not found, bad license, unsupported version, etc).
- Returns:
available – An enum that indicates “how available” the solver is. Note that the enum can be cast to bool, which will be True if the solver is runable at all and False otherwise.
- Return type:
- property config: HighsConfig
An object for configuring solve options.
- Returns:
An object for configuring pyomo solve options such as the time limit. These options are mostly independent of the solver.
- Return type:
- get_reduced_costs(vars_to_load=None)[source]
- Parameters:
vars_to_load (list) – A list of the variables whose reduced cost should be loaded. If vars_to_load is None, then all reduced costs will be loaded.
- Returns:
reduced_costs – Maps variable to reduced cost
- Return type:
ComponentMap
- property highs_options
A dictionary mapping solver options to values for those options. These are solver specific.
- Returns:
A dictionary mapping solver options to values for those options
- Return type:
- is_persistent()
- Returns:
is_persistent – True if the solver is a persistent solver.
- Return type:
- load_vars(vars_to_load=None)[source]
Load the solution of the primal variables into the value attribute of the variables.
- Parameters:
vars_to_load (list) – A list of the variables whose solution should be loaded. If vars_to_load is None, then the solution to all primal variables will be loaded.
- remove_block(block)
- set_objective(obj: _GeneralObjectiveData)
- solve(model, timer: HierarchicalTimer | None = None) Results [source]
Solve a Pyomo model.
- Parameters:
model (_BlockData) – The Pyomo model to be solved
timer (HierarchicalTimer) – An option timer for reporting timing
- Returns:
results – A results object
- Return type:
- property symbol_map
- update(timer: HierarchicalTimer | None = None)
- property update_config