diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 327f51c0f..31138c3ee 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -30,6 +30,7 @@ add_prefix(mp_docs ${DOC_BASEDIR}/ model-guide.rst modeling-overview.rst modeling-expressions.rst + modeling-mo.rst modeling-efficiency.rst modeling-numerics.rst modeling-tools.rst diff --git a/doc/source/features-guide.rst b/doc/source/features-guide.rst index bbc18dcf7..23513a041 100644 --- a/doc/source/features-guide.rst +++ b/doc/source/features-guide.rst @@ -883,9 +883,10 @@ Multiple objectives Many real world problems have multiple objectives; often this scenario is tackled by blending all the objectives by linear combination when formulating the model, or by minimizing each unwanted objective deviations from a pre-specified goal. -Many solvers can facilitate the formulation; the available functionalities are solver-specific; at MP level -they accessible via the main option ``obj:multi``. Consult the solver documentation for the functionalities available -on your solver. +Many solvers can facilitate the formulation; the available functionalities are solver-specific. For other solvers, +MP :ref:`emulates the multi-objective capability `. Consult the ``obj:multi`` +:ref:`option ` documentation +for the functionalities available on your solver. .. list-table:: :header-rows: 0 diff --git a/doc/source/model-guide.rst b/doc/source/model-guide.rst index f7e6372d8..5b1cb9b17 100644 --- a/doc/source/model-guide.rst +++ b/doc/source/model-guide.rst @@ -13,8 +13,9 @@ Ever wondered how to model logical and non-linear constraints? For example: - Piecewise-linear approximation of *y = sin(x)*. -MP automates many of such modeling tasks by reformulating AMPL nonlinear -constraints suitably for the given solver. +Moreover, MP supports :ref:`multiple-objectives`. +MP automates many of such modeling tasks by reformulating AMPL models +suitably for the given solver. A series of small modeling tasks like these are handled in the `MP Modeling Series `_, while below follows a comprehensive guide. @@ -25,6 +26,7 @@ while below follows a comprehensive guide. self modeling-overview modeling-expressions + modeling-mo modeling-efficiency modeling-numerics modeling-tools diff --git a/doc/source/modeling-mo.rst b/doc/source/modeling-mo.rst new file mode 100644 index 000000000..db5458e0b --- /dev/null +++ b/doc/source/modeling-mo.rst @@ -0,0 +1,46 @@ +.. _multiple-objectives: + + +Multiple objectives +---------------------------------- + +To consider multiple objectives in an AMPL model, use +:ref:`solver option ` ``obj:multi``. +Otherwise, only the 1st objective is considered +(or any objective specified by ``obj:no``.) + +.. code-block:: ampl + + minimize total_cost {s in STORE}: + sum {j in FOOD} cost[s,j] * Buy[j]; + + minimize total_number: sum {j in FOOD} Buy[j]; + + +See the +:ref:`Multi-objective AMPL Colab notebooks ` +for examples. + + +Blended objectives +************************************************ + +By default, all objectives are blended together +(summed up with the corresponding signs.) +Suffixes ``.objweight`` can be used to change the individual weights +and objective senses, according to the option ``obj:multi:weight``. + + +Lexicographical objectives +******************************************************** + +To apply hierarchical optimization, use suffix ``.objpriority``, +as described in the ``obj:multi`` option description. + +.. code-block:: ampl + + maximize ReverseSeniority {e in 1..2, i in I: E[i]==e}: + sum {t in V[i]: Pr[i, t]==0} + S[i] * x[i, t] + suffix objpriority (2-e)*S_range + 1 + S[i] - min {j in I} S[j]; + diff --git a/doc/source/modeling-overview.rst b/doc/source/modeling-overview.rst index 13b30162e..bd4a340c9 100644 --- a/doc/source/modeling-overview.rst +++ b/doc/source/modeling-overview.rst @@ -13,6 +13,9 @@ Currently available MP-based solvers include: - `gurobi `_, an enhanced interface to the `Gurobi solver `_ +- `cplexmp `_, + an enhanced interface to the `Gurobi solver `_ + - `copt `_, an interface to `Cardinal Optimizer `_