Skip to content

Commit

Permalink
deploy: 0fedabf
Browse files Browse the repository at this point in the history
  • Loading branch information
hlefebvr committed Oct 11, 2023
0 parents commit 6e1c52e
Show file tree
Hide file tree
Showing 269 changed files with 28,724 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
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: 05230886c7594d5c2e517b68f35c2d81
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added .doctrees/api/index.doctree
Binary file not shown.
Binary file added .doctrees/api/modeling/Annotation.doctree
Binary file not shown.
Binary file added .doctrees/api/modeling/Column.doctree
Binary file not shown.
Binary file added .doctrees/api/modeling/Constant.doctree
Binary file not shown.
Binary file added .doctrees/api/modeling/Ctr.doctree
Binary file not shown.
Binary file added .doctrees/api/modeling/Env.doctree
Binary file not shown.
Binary file added .doctrees/api/modeling/Expr.doctree
Binary file not shown.
Binary file added .doctrees/api/modeling/LinExpr.doctree
Binary file not shown.
Binary file added .doctrees/api/modeling/Model.doctree
Binary file not shown.
Binary file added .doctrees/api/modeling/Param.doctree
Binary file not shown.
Binary file added .doctrees/api/modeling/QuadExpr.doctree
Binary file not shown.
Binary file added .doctrees/api/modeling/Row.doctree
Binary file not shown.
Binary file added .doctrees/api/modeling/SolutionDual.doctree
Binary file not shown.
Binary file added .doctrees/api/modeling/SolutionPrimal.doctree
Binary file not shown.
Binary file added .doctrees/api/modeling/TempCtr.doctree
Binary file not shown.
Binary file added .doctrees/api/modeling/TempVar.doctree
Binary file not shown.
Binary file added .doctrees/api/modeling/Var.doctree
Binary file not shown.
Binary file added .doctrees/api/modeling/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 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 .doctrees/api/optimizers/callbacks/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/api/optimizers/glpk/GLPK.doctree
Binary file not shown.
Binary file added .doctrees/api/optimizers/glpk/index.doctree
Binary file not shown.
Binary file added .doctrees/api/optimizers/gurobi/Gurobi.doctree
Binary file not shown.
Binary file added .doctrees/api/optimizers/gurobi/index.doctree
Binary file not shown.
Binary file added .doctrees/api/optimizers/index.doctree
Binary file not shown.
Binary file added .doctrees/api/optimizers/mosek/Mosek.doctree
Binary file not shown.
Binary file added .doctrees/api/optimizers/mosek/index.doctree
Binary file not shown.
Binary file added .doctrees/api/problems/ProblemsFLP.doctree
Binary file not shown.
Binary file added .doctrees/api/problems/ProblemsGAP.doctree
Binary file not shown.
Binary file added .doctrees/api/problems/ProblemsKP.doctree
Binary file not shown.
Binary file added .doctrees/api/problems/ProblemsMKP.doctree
Binary file not shown.
Binary file added .doctrees/api/problems/ProblemsSRP.doctree
Binary file not shown.
Binary file added .doctrees/api/problems/index.doctree
Binary file not shown.
Binary file added .doctrees/api/tolerances.doctree
Binary file not shown.
Binary file added .doctrees/developer_guide/build-the-doc.doctree
Binary file not shown.
Binary file added .doctrees/developer_guide/index.doctree
Binary file not shown.
Binary file added .doctrees/developer_guide/tests.doctree
Binary file not shown.
Binary file added .doctrees/environment.pickle
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/examples/index.doctree
Binary file not shown.
Binary file added .doctrees/examples/knapsack-problem.doctree
Binary file not shown.
Binary file added .doctrees/index.doctree
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/installation/index.doctree
Binary file not shown.
Binary file added .doctrees/installation/linking.doctree
Binary file not shown.
Binary file added .doctrees/installation/local_installation.doctree
Binary file not shown.
Binary file added .doctrees/installation/mosek-and-socp.doctree
Binary file not shown.
Binary file added .doctrees/installation/options.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 .doctrees/tutorials/index.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file added .nojekyll
Empty file.
13 changes: 13 additions & 0 deletions _sources/api/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.. _api:

API
===

.. toctree::
:maxdepth: 2
:glob:

modeling/index
optimizers/index
problems/index
tolerances
4 changes: 4 additions & 0 deletions _sources/api/modeling/Annotation.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Annotation
==========

.. doxygenclass:: idol::Annotation
6 changes: 6 additions & 0 deletions _sources/api/modeling/Column.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _api_Column:

Column
======

.. doxygenclass:: idol::Column
6 changes: 6 additions & 0 deletions _sources/api/modeling/Constant.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _api_Constant:

Constant
========

.. doxygenclass:: idol::Constant
6 changes: 6 additions & 0 deletions _sources/api/modeling/Ctr.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _api_Ctr:

Ctr
===

.. doxygenclass:: idol::Ctr
4 changes: 4 additions & 0 deletions _sources/api/modeling/Env.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Env
===

.. doxygenclass:: idol::Env
6 changes: 6 additions & 0 deletions _sources/api/modeling/Expr.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _api_Expr:

Expr
====

.. doxygenclass:: idol::Expr
22 changes: 22 additions & 0 deletions _sources/api/modeling/LinExpr.rst.txt
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
55 changes: 55 additions & 0 deletions _sources/api/modeling/Model.rst.txt
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
6 changes: 6 additions & 0 deletions _sources/api/modeling/Param.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _api_Param:

Param
=====

.. doxygenclass:: idol::Param
4 changes: 4 additions & 0 deletions _sources/api/modeling/QuadExpr.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
QuadExpr
========

.. doxygenclass:: idol::QuadExpr
6 changes: 6 additions & 0 deletions _sources/api/modeling/Row.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _api_Row:

Row
===

.. doxygenclass:: idol::Row
6 changes: 6 additions & 0 deletions _sources/api/modeling/SolutionDual.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _api_SolutionDual:

Solution::Dual
================

.. doxygenclass:: idol::Solution::Dual
6 changes: 6 additions & 0 deletions _sources/api/modeling/SolutionPrimal.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _api_SolutionPrimal:

Solution::Primal
================

.. doxygenclass:: idol::Solution::Primal
6 changes: 6 additions & 0 deletions _sources/api/modeling/TempCtr.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _api_TempCtr:

TempCtr
=======

.. doxygenclass:: idol::TempCtr
6 changes: 6 additions & 0 deletions _sources/api/modeling/TempVar.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _api_TempVar:

TempVar
=======

.. doxygenclass:: idol::TempVar
6 changes: 6 additions & 0 deletions _sources/api/modeling/Var.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _api_var:

Var
===

.. doxygenclass:: idol::Var
10 changes: 10 additions & 0 deletions _sources/api/modeling/index.rst.txt
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 _sources/api/optimizers/branch-and-bound/BranchAndBound.rst.txt
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
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:
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _api_MostInfeasible:

MostInfeasible
==============

.. doxygenclass:: idol::MostInfeasible
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. _api_branching_rules:

Branching rules
===============

.. toctree::
:maxdepth: 2
:glob:

MostInfeasible
13 changes: 13 additions & 0 deletions _sources/api/optimizers/branch-and-bound/index.rst.txt
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _api_BestBound:

BestBound
=========

.. doxygenclass:: idol::BestBound
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _api_BreadthFirst:

BreadthFirst
============

.. doxygenclass:: idol::BreadthFirst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _api_DepthFirst:

DepthFirst
==========

.. doxygenclass:: idol::DepthFirst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _api_WorstBound:

WorstBound
==========

.. doxygenclass:: idol::WorstBound
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
Loading

0 comments on commit 6e1c52e

Please sign in to comment.