-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d629629
Showing
263 changed files
with
27,658 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: c62f1f10c075fad023e7e3bc3c7c21bb | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+53 KB
.doctrees/api/optimizers/branch-and-bound/BranchAndBoundCallback.doctree
Binary file not shown.
Binary file added
BIN
+30.7 KB
.doctrees/api/optimizers/branch-and-bound/branching-rules/MostInfeasible.doctree
Binary file not shown.
Binary file added
BIN
+3.28 KB
.doctrees/api/optimizers/branch-and-bound/branching-rules/index.doctree
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+20.6 KB
.doctrees/api/optimizers/branch-and-bound/node-selection-rules/BestBound.doctree
Binary file not shown.
Binary file added
BIN
+20.9 KB
.doctrees/api/optimizers/branch-and-bound/node-selection-rules/BreadthFirst.doctree
Binary file not shown.
Binary file added
BIN
+20.8 KB
.doctrees/api/optimizers/branch-and-bound/node-selection-rules/DepthFirst.doctree
Binary file not shown.
Binary file added
BIN
+20.8 KB
.doctrees/api/optimizers/branch-and-bound/node-selection-rules/WorstBound.doctree
Binary file not shown.
Binary file added
BIN
+3.55 KB
.doctrees/api/optimizers/branch-and-bound/node-selection-rules/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+161 KB
.doctrees/api/optimizers/column-generation/DantzigWolfeDecomposition.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+31.4 KB
.doctrees/tutorials/getting_started/modeling_optimization_problems.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.. _api: | ||
|
||
API | ||
=== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:glob: | ||
|
||
modeling/index | ||
optimizers/index | ||
problems/index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Annotation | ||
========== | ||
|
||
.. doxygenclass:: idol::Annotation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. _api_Column: | ||
|
||
Column | ||
====== | ||
|
||
.. doxygenclass:: idol::Column |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. _api_Constant: | ||
|
||
Constant | ||
======== | ||
|
||
.. doxygenclass:: idol::Constant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. _api_Ctr: | ||
|
||
Ctr | ||
=== | ||
|
||
.. doxygenclass:: idol::Ctr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Env | ||
=== | ||
|
||
.. doxygenclass:: idol::Env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. _api_Expr: | ||
|
||
Expr | ||
==== | ||
|
||
.. doxygenclass:: idol::Expr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
LinExpr | ||
======= | ||
|
||
This class is used to represent linear expressions in the modeling interface of idol. | ||
|
||
It consists in a set of linear terms which represent products of keys (typically, variables) and scalars. | ||
|
||
.. admonition:: Example | ||
|
||
In this example, we create a linear expression representing the following linear expression. | ||
|
||
.. math:: | ||
3 x_0 + 2 x_1 | ||
.. code-block:: cpp | ||
auto x = model.add_vars(Dim<1>(2), 0, Inf, Continuous, "x"); | ||
LinExpr lin_expr = 3 * x[0] + 2 * x[1]; | ||
.. doxygenclass:: idol::LinExpr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
.. _api_model: | ||
|
||
Model | ||
===== | ||
|
||
The Model class is probably the most central of idol. It is used to represent a mathematical optimization problem of the | ||
following general form. | ||
|
||
.. math:: | ||
\begin{array}{lll} | ||
\textrm{minimize } & \displaystyle \sum_{j=1}^n a_{0j}x_j + \sum_{j=1}^n\sum_{k=1}^n q_{jk}^0x_jx_k + b_0\\ | ||
\textrm{subject to } & \displaystyle \sum_{j=1}^n a_{ij}x_j + \sum_{j=1}^n\sum_{k=1}^n q^i_{jk}x_jx_k \le b_i & i=1,...,m \\ | ||
& l_j \le x_j \le u_j & j=1,...,m \\ | ||
& x_j\in\mathbb Z & j\in J_I, | ||
\end{array} | ||
Here, :math:`x_1, ..., x_n` are the decision variables with bounds :math:`[l_1,u_1],...,[l_n,u_n]` (possibly, | ||
:math:`l_j = -\infty` or :math:`u_j = +\infty`). Note that some variables have integrality requirements (i.e., those whose | ||
indices are in :math:`J_I`). Other entities are input parameters of the problem and must typically have real values | ||
(e.g., :math:`c_j, a_{ij}, q_{jk}^i` and :math:`b_i\in\mathbb R`). Alternatively, optimization problems can also be maximization | ||
problems. | ||
|
||
.. admonition:: Example: | ||
|
||
Here is a short example which builds and solves the following optimization problem. | ||
|
||
.. math:: | ||
\begin{array}{ll} | ||
\textrm{minimize } & -x_0 - 1.5 x_1 + 3 \\ | ||
\textrm{subject to } & x_0 + 2 x_1 \le 1.5 \\ | ||
& 0 \le x_0 \le 1 \\ | ||
& 0 \le x_1 \le 1 | ||
\end{array} | ||
.. code-block:: cpp | ||
Env env; | ||
Model model(env); | ||
auto x = model.add_vars(Dim<1>(2), 0, 1, Continuous, "x"); | ||
auto c = model.add_ctr(x[0] + 2 * x[1] <= 1.5); | ||
model.set_obj_expr(-x[0] - 1.5 * x[1] + 3); | ||
model.use(Gurobi()); | ||
model.optimize(); | ||
std::cout << "Best obj = " << model.get_best_obj() << std::endl; | ||
.. doxygenclass:: idol::Model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. _api_Param: | ||
|
||
Param | ||
===== | ||
|
||
.. doxygenclass:: idol::Param |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
QuadExpr | ||
======== | ||
|
||
.. doxygenclass:: idol::QuadExpr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. _api_Row: | ||
|
||
Row | ||
=== | ||
|
||
.. doxygenclass:: idol::Row |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. _api_SolutionDual: | ||
|
||
Solution::Dual | ||
================ | ||
|
||
.. doxygenclass:: idol::Solution::Dual |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. _api_SolutionPrimal: | ||
|
||
Solution::Primal | ||
================ | ||
|
||
.. doxygenclass:: idol::Solution::Primal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. _api_TempCtr: | ||
|
||
TempCtr | ||
======= | ||
|
||
.. doxygenclass:: idol::TempCtr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. _api_TempVar: | ||
|
||
TempVar | ||
======= | ||
|
||
.. doxygenclass:: idol::TempVar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. _api_var: | ||
|
||
Var | ||
=== | ||
|
||
.. doxygenclass:: idol::Var |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _api_modeling: | ||
|
||
Modeling | ||
======== | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
:glob: | ||
|
||
* |
31 changes: 31 additions & 0 deletions
31
_sources/api/optimizers/branch-and-bound/BranchAndBound.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.. _api_BranchAndBound: | ||
|
||
BranchAndBound | ||
============== | ||
|
||
This class is an optimizer factory which creates a new branch-and-bound algorithm. | ||
It can be used to create customized branch-and-bound algorithms with a large degree of freedom. | ||
|
||
.. seealso:: | ||
|
||
If you are not familiar with optimizers and optimizer factories, please refer to :ref:`this page <api_optimizers>`. | ||
|
||
.. admonition:: Example | ||
|
||
Here, we create a simple branch-and-bound algorithm where branching is done on integer variables which are being | ||
relaxed. Each node is solved by the external solver GLPK. Nodes are selected according to the "best-bound" | ||
rule while variables are selected according to the "most-infeasible" branching rule. | ||
|
||
The created algorithm also incorporates sub-tree exploration of maximum depth 2. | ||
|
||
.. code-block:: | ||
model.use( | ||
BranchAndBound() | ||
.with_node_optimizer( GLPK::ContinuousRelaxation() ) | ||
.with_branching_rule( MostInfeasible() ) | ||
.with_node_selection_rule( BestBound() ) | ||
.with_subtree_depth(2) | ||
); | ||
.. doxygenclass:: idol::BranchAndBound |
74 changes: 74 additions & 0 deletions
74
_sources/api/optimizers/branch-and-bound/BranchAndBoundCallback.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
.. _api_BranchAndBoundCallback: | ||
|
||
BranchAndBoundCallback | ||
====================== | ||
|
||
This class can be used to create callbacks to run on idol's :ref:`branch-and-bound implementation <api_BranchAndBound>`. | ||
|
||
.. warning:: | ||
|
||
BranchAndBoundCallback-s is an *advanced* feature. | ||
|
||
Please, make sure that what you are trying do cannot be done with | ||
a :ref:`solver-independent callback <api_Callback>` first, or with pre-existing callbacks, e.g., | ||
:ref:`UserCutCallback <api_UserCutCallback>` or :ref:`LazyCutCallback <api_LazyCutCallback>`. | ||
|
||
The advantage of using a :ref:`BranchAndBoundCallback <api_BranchAndBoundCallback>` instead of a standard | ||
solver-independent :ref:`Callback <api_Callback>` lies in the possibility to access specific information regarding | ||
the execution of the branch-and-bound algorithm. For instance, accessing a node's information, or the current | ||
relaxation model being solved. | ||
|
||
.. admonition:: Example | ||
|
||
Here is an example of callback which prints out the event triggering it and, when the event corresponds to `NodeLoaded`, | ||
prints the node's model to be solved. | ||
|
||
.. code-block:: | ||
class MyCallback : public BranchAndBoundCallbackFactory<NodeInfo> { | ||
public: | ||
class Strategy : public BranchAndBoundCallback<NodeInfo> { | ||
protected: | ||
void operator()(CallbackEvent t_event) override { | ||
std::cout << "MyCallback is called for " << t_event << std::endl; | ||
if (t_event != NodeLoaded) { | ||
return; | ||
} | ||
std::cout << "The problem being solve at node " << node().id() << std::endl; | ||
std::cout << relaxation() << std::endl; | ||
} | ||
}; | ||
BranchAndBoundCallback<NodeInfo> *operator()() override { | ||
return new Strategy(); | ||
} | ||
[[nodiscard]] BranchAndBoundCallbackFactory<NodeInfo> *clone() const override { | ||
return new MyCallback(*this); | ||
} | ||
}; | ||
Then, this callback can be used as follows. | ||
|
||
.. code-block:: | ||
model.use( | ||
BranchAndBound() | ||
.with_node_optimizer(GLPK::ContinuousRelaxation()) | ||
.with_branching_rule(MostInfeasible()) | ||
.with_node_selection_rule(DepthFirst()) | ||
.with_callback(MyCallback()); | ||
); | ||
.. hint:: | ||
|
||
By default, most of the objects returned by BranchAndBoundCallback methods are const. If you wish to access non-const | ||
versions (e.g., if you want to perform non-standard updates to the relaxed model or want to change the node's current | ||
information manually), you should use the advanced interface obtained by calling ``BranchAndBoundCallback::advanced_interface``. | ||
|
||
.. doxygenclass:: idol::BranchAndBoundCallback | ||
:protected-members: |
6 changes: 6 additions & 0 deletions
6
_sources/api/optimizers/branch-and-bound/branching-rules/MostInfeasible.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. _api_MostInfeasible: | ||
|
||
MostInfeasible | ||
============== | ||
|
||
.. doxygenclass:: idol::MostInfeasible |
10 changes: 10 additions & 0 deletions
10
_sources/api/optimizers/branch-and-bound/branching-rules/index.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _api_branching_rules: | ||
|
||
Branching rules | ||
=============== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:glob: | ||
|
||
MostInfeasible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.. _api_branch_and_bound: | ||
|
||
Branch-And-Bound algorithms | ||
=========================== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:glob: | ||
|
||
BranchAndBound | ||
branching-rules/index | ||
node-selection-rules/index | ||
BranchAndBoundCallback |
6 changes: 6 additions & 0 deletions
6
_sources/api/optimizers/branch-and-bound/node-selection-rules/BestBound.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. _api_BestBound: | ||
|
||
BestBound | ||
========= | ||
|
||
.. doxygenclass:: idol::BestBound |
6 changes: 6 additions & 0 deletions
6
_sources/api/optimizers/branch-and-bound/node-selection-rules/BreadthFirst.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. _api_BreadthFirst: | ||
|
||
BreadthFirst | ||
============ | ||
|
||
.. doxygenclass:: idol::BreadthFirst |
6 changes: 6 additions & 0 deletions
6
_sources/api/optimizers/branch-and-bound/node-selection-rules/DepthFirst.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. _api_DepthFirst: | ||
|
||
DepthFirst | ||
========== | ||
|
||
.. doxygenclass:: idol::DepthFirst |
6 changes: 6 additions & 0 deletions
6
_sources/api/optimizers/branch-and-bound/node-selection-rules/WorstBound.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.. _api_WorstBound: | ||
|
||
WorstBound | ||
========== | ||
|
||
.. doxygenclass:: idol::WorstBound |
13 changes: 13 additions & 0 deletions
13
_sources/api/optimizers/branch-and-bound/node-selection-rules/index.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.. _api_node_selection_rules: | ||
|
||
Node selection rules | ||
==================== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:glob: | ||
|
||
BestBound | ||
WorstBound | ||
DepthFirst | ||
BreadthFirst |
Oops, something went wrong.