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(),\n(arithmetics)"| node_3 node_1 --> |"matrix()"| node_6 node_3 --> |"equal_to(),\nless_equal(),\n..."|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 as Result, 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.

2. How to create decision variables

This page explains how to create the decision variables, the first step in the formulation process.

3. Polynomials and objective functions

This page explains how to express the objective function, which corresponds to the degree of achievement of an objective.

4. Constraint construction

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.

5. Model formulation

This page explains how to express the formulation of combinatorial optimization problems in program code.

6. Solver client

This page describes how to create a solver client that abstracts each solver.

7. Solving combinatorial optimization problems

This page describes solving combinatorial optimization problems using a model and a solver client.