Problems¶
Abstract Problem Class¶
The abstract Problem class serves as the base for all problem formulations within the EngiOptiQA framework. It defines the common interface and structure that concrete problem classes must implement. This includes methods for:
Discretization of problem variables:
Encode continuous or discrete problem variables in terms of binary variables.
Generation of problem formulation:
Build an Amplify Model (based on a polynomial in binary variables) that represents the objective and constraints.
The model is then provided to the any EngiOptiQA solver for optimization.
Furthermore, specific problem formulations can override existing methods, e.g., for post-processing and analyzing results returned by the solvers, such as:
Analysis of results:
Post-process the raw solution (binary variables) returned by the solver. This may involve decoding the binary solution back into the original problem variables, evaluating the objective function or other quantities of interest.
- class engioptiqa.problems.problem.Problem(output_path=None)¶
Abstract base class for EngiOptiQA problems.
- Parameters:
output_path – Optional path for saving results.
- analyze_results(results=None)¶
Analyze results computed or returned by a solver.
- Parameters:
results – Optional results to analyze. If not provided, will attempt to use self.results computed by a solver.
- Returns:
List of solutions (dictionaries) containing information (bit array, energy, frequency).
- abstractmethod generate_discretization()¶
Discretize problem variables into binary representation.
- abstractmethod generate_problem_formulation()¶
Generate problem formulation as an Amplify Model based on a polynomial in binary variables for the objective to be minimized including constraints.