1. Amplify SDK Overview¶
Before we go into the functionality details, let us summarize the overall picture and execution flow of the Amplify SDK.
The Amplify SDK performs optimization by formulating a combinatorial optimization problem using the following steps (1) to (6).
%%{init:{'theme':'neutral'}}%% flowchart TB node_1("VariableGenerator") node_2("PolyArray") node_3("Poly") node_4("Constraint/ConstraintList") node_5("Model") node_6("Matrix") node_7("Result") node_8{{"solve(model, client)"}} node_20("ClientA / ClientB / ...") node_1 --> |"array()"| node_2 node_1 --> |"scalar()"| node_3 node_2 --> |"sum(),<br>(arithmetics)"| node_3 node_1 --> |"matrix()"| node_6 node_3 --> |"equal_to(),<br>less_equal(),<br>..."|node_4 node_3 --> node_5 node_4 --> node_5 node_6 --> node_5 node_5 --> node_8 node_20 ------> node_8 node_8 --> node_7
- (1) Decision variables
First, create a generator (
VariableGenerator
) that creates decision variables. Next, create a variable (Poly
) or an array of variables (PolyArray
) using the VariableGenerator. If the problem you want to formulate is a quadratic programming problem, you can also create a coefficient matrix (Matrix
) for the quadratic programming problem.- (2) Objective function
An objective function is constructed using the variables generated by the VariableGenerator. You can define the function as a polynomial (
Poly
) or a coefficient matrix (Matrix
).- (3) Constraint
Constraints (
Constraint
) are constructed from polynomials using constraint creation functions. If multiple constraints are needed, you can combine them into a constraint list (ConstraintList
).- (4) Optimization model
An optimization model (
Model
) is created from the objective function and constraints.- (5) Solver client
Specify a machine or solver to use and create a solver client (e.g.,
FixstarsClient
).- (6) Solver execution
Pass the optimization model and solver client, and run the optimization through
solve
function. The result of the execution is returned asResult
, and the objective function value and the variables of the optimal solution can be obtained.
Each of the above steps is described in detail on the following pages.
This page explains how to create the decision variables, the first step in the formulation process.
This page explains how to express the objective function, which corresponds to the degree of achievement of an objective.
This page explains how to set constraints on the range of possible values for a decision variable and how to construct a constraint object using polynomials.
This page explains how to express the formulation of combinatorial optimization problems in program code.
This page describes how to create a solver client that abstracts each solver.
This page describes solving combinatorial optimization problems using a model and a solver client.