desdeo 1.2__py3-none-any.whl → 2.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- desdeo/__init__.py +8 -8
- desdeo/adm/ADMAfsar.py +551 -0
- desdeo/adm/ADMChen.py +414 -0
- desdeo/adm/BaseADM.py +119 -0
- desdeo/adm/__init__.py +11 -0
- desdeo/api/README.md +73 -0
- desdeo/api/__init__.py +15 -0
- desdeo/api/app.py +50 -0
- desdeo/api/config.py +90 -0
- desdeo/api/config.toml +64 -0
- desdeo/api/db.py +27 -0
- desdeo/api/db_init.py +85 -0
- desdeo/api/db_models.py +164 -0
- desdeo/api/malaga_db_init.py +27 -0
- desdeo/api/models/__init__.py +266 -0
- desdeo/api/models/archive.py +23 -0
- desdeo/api/models/emo.py +128 -0
- desdeo/api/models/enautilus.py +69 -0
- desdeo/api/models/gdm/gdm_aggregate.py +139 -0
- desdeo/api/models/gdm/gdm_base.py +69 -0
- desdeo/api/models/gdm/gdm_score_bands.py +114 -0
- desdeo/api/models/gdm/gnimbus.py +138 -0
- desdeo/api/models/generic.py +104 -0
- desdeo/api/models/generic_states.py +401 -0
- desdeo/api/models/nimbus.py +158 -0
- desdeo/api/models/preference.py +128 -0
- desdeo/api/models/problem.py +717 -0
- desdeo/api/models/reference_point_method.py +18 -0
- desdeo/api/models/session.py +49 -0
- desdeo/api/models/state.py +463 -0
- desdeo/api/models/user.py +52 -0
- desdeo/api/models/utopia.py +25 -0
- desdeo/api/routers/_EMO.backup +309 -0
- desdeo/api/routers/_NAUTILUS.py +245 -0
- desdeo/api/routers/_NAUTILUS_navigator.py +233 -0
- desdeo/api/routers/_NIMBUS.py +765 -0
- desdeo/api/routers/__init__.py +5 -0
- desdeo/api/routers/emo.py +497 -0
- desdeo/api/routers/enautilus.py +237 -0
- desdeo/api/routers/gdm/gdm_aggregate.py +234 -0
- desdeo/api/routers/gdm/gdm_base.py +420 -0
- desdeo/api/routers/gdm/gdm_score_bands/gdm_score_bands_manager.py +398 -0
- desdeo/api/routers/gdm/gdm_score_bands/gdm_score_bands_routers.py +377 -0
- desdeo/api/routers/gdm/gnimbus/gnimbus_manager.py +698 -0
- desdeo/api/routers/gdm/gnimbus/gnimbus_routers.py +591 -0
- desdeo/api/routers/generic.py +233 -0
- desdeo/api/routers/nimbus.py +705 -0
- desdeo/api/routers/problem.py +307 -0
- desdeo/api/routers/reference_point_method.py +93 -0
- desdeo/api/routers/session.py +100 -0
- desdeo/api/routers/test.py +16 -0
- desdeo/api/routers/user_authentication.py +520 -0
- desdeo/api/routers/utils.py +187 -0
- desdeo/api/routers/utopia.py +230 -0
- desdeo/api/schema.py +100 -0
- desdeo/api/tests/__init__.py +0 -0
- desdeo/api/tests/conftest.py +151 -0
- desdeo/api/tests/test_enautilus.py +330 -0
- desdeo/api/tests/test_models.py +1179 -0
- desdeo/api/tests/test_routes.py +1075 -0
- desdeo/api/utils/_database.py +263 -0
- desdeo/api/utils/_logger.py +29 -0
- desdeo/api/utils/database.py +36 -0
- desdeo/api/utils/emo_database.py +40 -0
- desdeo/core.py +34 -0
- desdeo/emo/__init__.py +159 -0
- desdeo/emo/hooks/archivers.py +188 -0
- desdeo/emo/methods/EAs.py +541 -0
- desdeo/emo/methods/__init__.py +0 -0
- desdeo/emo/methods/bases.py +12 -0
- desdeo/emo/methods/templates.py +111 -0
- desdeo/emo/operators/__init__.py +1 -0
- desdeo/emo/operators/crossover.py +1282 -0
- desdeo/emo/operators/evaluator.py +114 -0
- desdeo/emo/operators/generator.py +459 -0
- desdeo/emo/operators/mutation.py +1224 -0
- desdeo/emo/operators/scalar_selection.py +202 -0
- desdeo/emo/operators/selection.py +1778 -0
- desdeo/emo/operators/termination.py +286 -0
- desdeo/emo/options/__init__.py +108 -0
- desdeo/emo/options/algorithms.py +435 -0
- desdeo/emo/options/crossover.py +164 -0
- desdeo/emo/options/generator.py +131 -0
- desdeo/emo/options/mutation.py +260 -0
- desdeo/emo/options/repair.py +61 -0
- desdeo/emo/options/scalar_selection.py +66 -0
- desdeo/emo/options/selection.py +127 -0
- desdeo/emo/options/templates.py +383 -0
- desdeo/emo/options/termination.py +143 -0
- desdeo/explanations/__init__.py +6 -0
- desdeo/explanations/explainer.py +100 -0
- desdeo/explanations/utils.py +90 -0
- desdeo/gdm/__init__.py +22 -0
- desdeo/gdm/gdmtools.py +45 -0
- desdeo/gdm/score_bands.py +114 -0
- desdeo/gdm/voting_rules.py +50 -0
- desdeo/mcdm/__init__.py +41 -0
- desdeo/mcdm/enautilus.py +338 -0
- desdeo/mcdm/gnimbus.py +484 -0
- desdeo/mcdm/nautili.py +345 -0
- desdeo/mcdm/nautilus.py +477 -0
- desdeo/mcdm/nautilus_navigator.py +656 -0
- desdeo/mcdm/nimbus.py +417 -0
- desdeo/mcdm/pareto_navigator.py +269 -0
- desdeo/mcdm/reference_point_method.py +186 -0
- desdeo/problem/__init__.py +83 -0
- desdeo/problem/evaluator.py +561 -0
- desdeo/problem/external/__init__.py +18 -0
- desdeo/problem/external/core.py +356 -0
- desdeo/problem/external/pymoo_provider.py +266 -0
- desdeo/problem/external/runtime.py +44 -0
- desdeo/problem/gurobipy_evaluator.py +562 -0
- desdeo/problem/infix_parser.py +341 -0
- desdeo/problem/json_parser.py +944 -0
- desdeo/problem/pyomo_evaluator.py +487 -0
- desdeo/problem/schema.py +1829 -0
- desdeo/problem/simulator_evaluator.py +348 -0
- desdeo/problem/sympy_evaluator.py +244 -0
- desdeo/problem/testproblems/__init__.py +88 -0
- desdeo/problem/testproblems/benchmarks_server.py +120 -0
- desdeo/problem/testproblems/binh_and_korn_problem.py +88 -0
- desdeo/problem/testproblems/cake_problem.py +185 -0
- desdeo/problem/testproblems/dmitry_forest_problem_discrete.py +71 -0
- desdeo/problem/testproblems/dtlz2_problem.py +102 -0
- desdeo/problem/testproblems/forest_problem.py +283 -0
- desdeo/problem/testproblems/knapsack_problem.py +163 -0
- desdeo/problem/testproblems/mcwb_problem.py +831 -0
- desdeo/problem/testproblems/mixed_variable_dimenrions_problem.py +83 -0
- desdeo/problem/testproblems/momip_problem.py +172 -0
- desdeo/problem/testproblems/multi_valued_constraints.py +119 -0
- desdeo/problem/testproblems/nimbus_problem.py +143 -0
- desdeo/problem/testproblems/pareto_navigator_problem.py +89 -0
- desdeo/problem/testproblems/re_problem.py +492 -0
- desdeo/problem/testproblems/river_pollution_problems.py +440 -0
- desdeo/problem/testproblems/rocket_injector_design_problem.py +140 -0
- desdeo/problem/testproblems/simple_problem.py +351 -0
- desdeo/problem/testproblems/simulator_problem.py +92 -0
- desdeo/problem/testproblems/single_objective.py +289 -0
- desdeo/problem/testproblems/spanish_sustainability_problem.py +945 -0
- desdeo/problem/testproblems/zdt_problem.py +274 -0
- desdeo/problem/utils.py +245 -0
- desdeo/tools/GenerateReferencePoints.py +181 -0
- desdeo/tools/__init__.py +120 -0
- desdeo/tools/desc_gen.py +22 -0
- desdeo/tools/generics.py +165 -0
- desdeo/tools/group_scalarization.py +3090 -0
- desdeo/tools/gurobipy_solver_interfaces.py +258 -0
- desdeo/tools/indicators_binary.py +117 -0
- desdeo/tools/indicators_unary.py +362 -0
- desdeo/tools/interaction_schema.py +38 -0
- desdeo/tools/intersection.py +54 -0
- desdeo/tools/iterative_pareto_representer.py +99 -0
- desdeo/tools/message.py +265 -0
- desdeo/tools/ng_solver_interfaces.py +199 -0
- desdeo/tools/non_dominated_sorting.py +134 -0
- desdeo/tools/patterns.py +283 -0
- desdeo/tools/proximal_solver.py +99 -0
- desdeo/tools/pyomo_solver_interfaces.py +477 -0
- desdeo/tools/reference_vectors.py +229 -0
- desdeo/tools/scalarization.py +2065 -0
- desdeo/tools/scipy_solver_interfaces.py +454 -0
- desdeo/tools/score_bands.py +627 -0
- desdeo/tools/utils.py +388 -0
- desdeo/tools/visualizations.py +67 -0
- desdeo/utopia_stuff/__init__.py +0 -0
- desdeo/utopia_stuff/data/1.json +15 -0
- desdeo/utopia_stuff/data/2.json +13 -0
- desdeo/utopia_stuff/data/3.json +15 -0
- desdeo/utopia_stuff/data/4.json +17 -0
- desdeo/utopia_stuff/data/5.json +15 -0
- desdeo/utopia_stuff/from_json.py +40 -0
- desdeo/utopia_stuff/reinit_user.py +38 -0
- desdeo/utopia_stuff/utopia_db_init.py +212 -0
- desdeo/utopia_stuff/utopia_problem.py +403 -0
- desdeo/utopia_stuff/utopia_problem_old.py +415 -0
- desdeo/utopia_stuff/utopia_reference_solutions.py +79 -0
- desdeo-2.1.0.dist-info/METADATA +186 -0
- desdeo-2.1.0.dist-info/RECORD +180 -0
- {desdeo-1.2.dist-info → desdeo-2.1.0.dist-info}/WHEEL +1 -1
- desdeo-2.1.0.dist-info/licenses/LICENSE +21 -0
- desdeo-1.2.dist-info/METADATA +0 -16
- desdeo-1.2.dist-info/RECORD +0 -4
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
from desdeo.problem.schema import (
|
|
2
|
+
Objective,
|
|
3
|
+
Problem,
|
|
4
|
+
TensorVariable,
|
|
5
|
+
Variable,
|
|
6
|
+
VariableTypeEnum,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
def mixed_variable_dimensions_problem():
|
|
10
|
+
"""Defines a problem with variables with mixed dimensions.
|
|
11
|
+
|
|
12
|
+
Has both Variable and TensorVariable types of variables, where the TensorVariables have
|
|
13
|
+
varying number of dimensions. Mostly for testing purposes.
|
|
14
|
+
"""
|
|
15
|
+
x = Variable(
|
|
16
|
+
name="Regular variable",
|
|
17
|
+
symbol="x",
|
|
18
|
+
variable_type=VariableTypeEnum.real,
|
|
19
|
+
lowerbound=-1.0,
|
|
20
|
+
upperbound=1.0,
|
|
21
|
+
initial_value=0.5,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
y = TensorVariable(
|
|
25
|
+
name="1D vector",
|
|
26
|
+
symbol="Y",
|
|
27
|
+
shape=[5],
|
|
28
|
+
variable_type=VariableTypeEnum.real,
|
|
29
|
+
lowerbounds=5,
|
|
30
|
+
upperbounds=5,
|
|
31
|
+
initial_values=5,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
z = TensorVariable(
|
|
35
|
+
name="2D vector",
|
|
36
|
+
symbol="Z",
|
|
37
|
+
shape=[5, 2],
|
|
38
|
+
variable_type=VariableTypeEnum.real,
|
|
39
|
+
lowerbounds=-100,
|
|
40
|
+
upperbounds=100,
|
|
41
|
+
initial_values=1,
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
a = TensorVariable(
|
|
45
|
+
name="2D vector",
|
|
46
|
+
symbol="A",
|
|
47
|
+
shape=[2, 3, 2],
|
|
48
|
+
variable_type=VariableTypeEnum.real,
|
|
49
|
+
lowerbounds=-100,
|
|
50
|
+
upperbounds=100,
|
|
51
|
+
initial_values=1,
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
dummy = Objective(
|
|
55
|
+
name="dummy objective, not relevant",
|
|
56
|
+
symbol="f_1",
|
|
57
|
+
func="x - Y[1]",
|
|
58
|
+
maximize=False,
|
|
59
|
+
ideal=-1000,
|
|
60
|
+
nadir=1000,
|
|
61
|
+
is_linear=True,
|
|
62
|
+
is_convex=True,
|
|
63
|
+
is_twice_differentiable=True,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
dummy2 = Objective(
|
|
67
|
+
name="dummy objective, not relevant",
|
|
68
|
+
symbol="f_2",
|
|
69
|
+
func="-x + Y[1]",
|
|
70
|
+
maximize=False,
|
|
71
|
+
ideal=-1000,
|
|
72
|
+
nadir=1000,
|
|
73
|
+
is_linear=True,
|
|
74
|
+
is_convex=True,
|
|
75
|
+
is_twice_differentiable=True,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
return Problem(
|
|
79
|
+
name="Mixed variable dimensions problem",
|
|
80
|
+
description="A problem with variables with mixed dimensions. For testing.",
|
|
81
|
+
variables=[x, y, z, a],
|
|
82
|
+
objectives=[dummy, dummy2],
|
|
83
|
+
)
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
from desdeo.problem.schema import (
|
|
2
|
+
Constraint,
|
|
3
|
+
ConstraintTypeEnum,
|
|
4
|
+
Objective,
|
|
5
|
+
ObjectiveTypeEnum,
|
|
6
|
+
Problem,
|
|
7
|
+
Variable,
|
|
8
|
+
VariableTypeEnum,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def momip_ti2() -> Problem:
|
|
13
|
+
"""Defines the mixed-integer multiobjective optimization problem test instance 2 (TI2).
|
|
14
|
+
|
|
15
|
+
The problem has four variables, two continuous and two integer. The Pareto optimal solutions
|
|
16
|
+
hold for solutions with x_1^2 + x_2^2 = 0.25 and (x_3, x_4) = {(0, -1), (-1, 0)}.
|
|
17
|
+
|
|
18
|
+
References:
|
|
19
|
+
Eichfelder, G., Gerlach, T., & Warnow, L. (n.d.). Test Instances for
|
|
20
|
+
Multiobjective Mixed-Integer Nonlinear Optimization.
|
|
21
|
+
"""
|
|
22
|
+
x_1 = Variable(name="x_1", symbol="x_1", variable_type=VariableTypeEnum.real, lowerbound=-1.0, upperbound=1.0)
|
|
23
|
+
x_2 = Variable(name="x_2", symbol="x_2", variable_type=VariableTypeEnum.real, lowerbound=-1.0, upperbound=1.0)
|
|
24
|
+
x_3 = Variable(name="x_3", symbol="x_3", variable_type=VariableTypeEnum.integer, lowerbound=-1, upperbound=1)
|
|
25
|
+
x_4 = Variable(name="x_4", symbol="x_4", variable_type=VariableTypeEnum.integer, lowerbound=-1, upperbound=1)
|
|
26
|
+
|
|
27
|
+
f_1 = Objective(
|
|
28
|
+
name="f_1",
|
|
29
|
+
symbol="f_1",
|
|
30
|
+
func="x_1 + x_3",
|
|
31
|
+
objective_type=ObjectiveTypeEnum.analytical,
|
|
32
|
+
maximize=False,
|
|
33
|
+
is_linear=True,
|
|
34
|
+
is_convex=True,
|
|
35
|
+
is_twice_differentiable=True,
|
|
36
|
+
)
|
|
37
|
+
f_2 = Objective(
|
|
38
|
+
name="f_2",
|
|
39
|
+
symbol="f_2",
|
|
40
|
+
func="x_2 + x_4",
|
|
41
|
+
objective_type=ObjectiveTypeEnum.analytical,
|
|
42
|
+
maximize=False,
|
|
43
|
+
is_linear=True,
|
|
44
|
+
is_convex=True,
|
|
45
|
+
is_twice_differentiable=True,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
con_1 = Constraint(
|
|
49
|
+
name="g_1",
|
|
50
|
+
symbol="g_1",
|
|
51
|
+
cons_type=ConstraintTypeEnum.LTE,
|
|
52
|
+
func="x_1**2 + x_2**2 - 0.25",
|
|
53
|
+
is_linear=False,
|
|
54
|
+
is_convex=False,
|
|
55
|
+
is_twice_differentiable=True,
|
|
56
|
+
)
|
|
57
|
+
con_2 = Constraint(
|
|
58
|
+
name="g_2",
|
|
59
|
+
symbol="g_2",
|
|
60
|
+
cons_type=ConstraintTypeEnum.LTE,
|
|
61
|
+
func="x_3**2 + x_4**2 - 1",
|
|
62
|
+
is_linear=False,
|
|
63
|
+
is_convex=False,
|
|
64
|
+
is_twice_differentiable=True,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
return Problem(
|
|
68
|
+
name="MOMIP Test Instance 2",
|
|
69
|
+
description="Test instance 2",
|
|
70
|
+
variables=[x_1, x_2, x_3, x_4],
|
|
71
|
+
constraints=[con_1, con_2],
|
|
72
|
+
objectives=[f_1, f_2],
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def momip_ti7() -> Problem:
|
|
77
|
+
r"""Defines the mixed-integer multiobjective optimization problem test instance 7 (T7).
|
|
78
|
+
|
|
79
|
+
The problem is defined as follows:
|
|
80
|
+
|
|
81
|
+
\begin{align}
|
|
82
|
+
&\min_{\mathbf{x}} & f_1(\mathbf{x}) & = x_1 + x_4 \\
|
|
83
|
+
&\max_{\mathbf{x}} & f_2(\mathbf{x}) & = -(x_2 + x_5) \\
|
|
84
|
+
&\min_{\mathbf{x}} & f_3(\mathbf{x}) & = x_3 + x_6 \\
|
|
85
|
+
&\text{s.t.,} & x_1^2 +x_2^2 + x_3^2 & \leq 1,\\
|
|
86
|
+
& & x_4^2 + x_5^2 + x_6^2 & \leq 1,\\
|
|
87
|
+
& & -1 \leq x_i \leq 1&\;\text{for}\;i=\{1,2,3\},\\
|
|
88
|
+
& & x_i \in \{-1, 0, 1\}&\;\text{for}\;i=\{4, 5, 6\}.
|
|
89
|
+
\end{align}
|
|
90
|
+
|
|
91
|
+
In the problem, $x_1, x_2, x_3$ are real-valued and $x_4, x_5, x_6$ are integer-valued. The problem
|
|
92
|
+
is convex and differentiable.
|
|
93
|
+
|
|
94
|
+
The Pareto optimal integer assignments are $(x_4, x_5, x_6) \in {(0,0,-1), (0, -1, 0), (-1,0,0)}$,
|
|
95
|
+
and the real-valued assignments are $\{x_1, x_2, x_3 \in \mathbb{R}^3 |
|
|
96
|
+
x_1^2 + x_2^2 + x_3^2 = 1, x_1 \leq 0, x_2 \leq 0, x_3 \leq 0\}$. Unlike in the original definition,
|
|
97
|
+
$f_2$ is formulated to be maximized instead of minimized.
|
|
98
|
+
|
|
99
|
+
References:
|
|
100
|
+
Eichfelder, G., Gerlach, T., & Warnow, L. (n.d.). Test Instances for
|
|
101
|
+
Multiobjective Mixed-Integer Nonlinear Optimization.
|
|
102
|
+
"""
|
|
103
|
+
x_1 = Variable(name="x_1", symbol="x_1", variable_type=VariableTypeEnum.real)
|
|
104
|
+
x_2 = Variable(name="x_2", symbol="x_2", variable_type=VariableTypeEnum.real)
|
|
105
|
+
x_3 = Variable(name="x_3", symbol="x_3", variable_type=VariableTypeEnum.real)
|
|
106
|
+
x_4 = Variable(name="x_4", symbol="x_4", variable_type=VariableTypeEnum.integer, lowerbound=-1, upperbound=1)
|
|
107
|
+
x_5 = Variable(name="x_5", symbol="x_5", variable_type=VariableTypeEnum.integer, lowerbound=-1, upperbound=1)
|
|
108
|
+
x_6 = Variable(name="x_6", symbol="x_6", variable_type=VariableTypeEnum.integer, lowerbound=-1, upperbound=1)
|
|
109
|
+
|
|
110
|
+
f_1 = Objective(
|
|
111
|
+
name="f_1",
|
|
112
|
+
symbol="f_1",
|
|
113
|
+
func="x_1 + x_4",
|
|
114
|
+
objective_type=ObjectiveTypeEnum.analytical,
|
|
115
|
+
ideal=-3,
|
|
116
|
+
nadir=3,
|
|
117
|
+
maximize=False,
|
|
118
|
+
is_linear=True,
|
|
119
|
+
is_convex=True,
|
|
120
|
+
is_twice_differentiable=True,
|
|
121
|
+
)
|
|
122
|
+
f_2 = Objective(
|
|
123
|
+
name="f_2",
|
|
124
|
+
symbol="f_2",
|
|
125
|
+
func="-(x_2 + x_5)",
|
|
126
|
+
objective_type=ObjectiveTypeEnum.analytical,
|
|
127
|
+
ideal=3,
|
|
128
|
+
nadir=-3,
|
|
129
|
+
maximize=True,
|
|
130
|
+
is_linear=True,
|
|
131
|
+
is_convex=True,
|
|
132
|
+
is_twice_differentiable=True,
|
|
133
|
+
)
|
|
134
|
+
f_3 = Objective(
|
|
135
|
+
name="f_3",
|
|
136
|
+
symbol="f_3",
|
|
137
|
+
func="x_3 + x_6",
|
|
138
|
+
objective_type=ObjectiveTypeEnum.analytical,
|
|
139
|
+
ideal=-3,
|
|
140
|
+
nadir=3,
|
|
141
|
+
maximize=False,
|
|
142
|
+
is_linear=True,
|
|
143
|
+
is_convex=True,
|
|
144
|
+
is_twice_differentiable=True,
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
con_1 = Constraint(
|
|
148
|
+
name="g_1",
|
|
149
|
+
symbol="g_1",
|
|
150
|
+
cons_type=ConstraintTypeEnum.LTE,
|
|
151
|
+
func="x_1**2 + x_2**2 + x_3**2 - 1",
|
|
152
|
+
is_linear=False,
|
|
153
|
+
is_convex=False,
|
|
154
|
+
is_twice_differentiable=True,
|
|
155
|
+
)
|
|
156
|
+
con_2 = Constraint(
|
|
157
|
+
name="g_2",
|
|
158
|
+
symbol="g_2",
|
|
159
|
+
cons_type=ConstraintTypeEnum.LTE,
|
|
160
|
+
func="x_4**2 + x_5**2 + x_6**2 - 1",
|
|
161
|
+
is_linear=False,
|
|
162
|
+
is_convex=False,
|
|
163
|
+
is_twice_differentiable=True,
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
return Problem(
|
|
167
|
+
name="MOMIP Test Instance 7",
|
|
168
|
+
description="Test instance 17",
|
|
169
|
+
variables=[x_1, x_2, x_3, x_4, x_5, x_6],
|
|
170
|
+
constraints=[con_1, con_2],
|
|
171
|
+
objectives=[f_1, f_2, f_3],
|
|
172
|
+
)
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"""Defines a test problem with a constraint that is multi-valued."""
|
|
2
|
+
|
|
3
|
+
from desdeo.problem import (
|
|
4
|
+
Constant,
|
|
5
|
+
Constraint,
|
|
6
|
+
ConstraintTypeEnum,
|
|
7
|
+
Objective,
|
|
8
|
+
ObjectiveTypeEnum,
|
|
9
|
+
Problem,
|
|
10
|
+
TensorConstant,
|
|
11
|
+
TensorVariable,
|
|
12
|
+
Variable,
|
|
13
|
+
VariableTypeEnum,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def multi_valued_constraint_problem() -> Problem:
|
|
18
|
+
r"""Defines a test problem with a multi-valued constraint.
|
|
19
|
+
|
|
20
|
+
The problem has two objectives, two variables, and two constraints, the other of which, is multi-valued.
|
|
21
|
+
The problem is defined as follows:
|
|
22
|
+
\[
|
|
23
|
+
\begin{aligned}
|
|
24
|
+
\text{Min} \quad
|
|
25
|
+
& f_1(x_1, x_2, y) = x_1^2 + x_2^2 + y^2, \\[4pt]
|
|
26
|
+
\text{Min} \quad
|
|
27
|
+
& f_2(x_1, x_2, y) = (x_1 - 2)^2 + (x_2 - 1)^2 + (y - 1)^2, \\[6pt]
|
|
28
|
+
\text{subject to} \quad
|
|
29
|
+
& g(x_1, x_2, y) = x_1^2 + x_2 + y - 2 \le 0, \\[4pt]
|
|
30
|
+
& G(x_1, x_2) = A
|
|
31
|
+
\begin{bmatrix}
|
|
32
|
+
x_1 \\[2pt]
|
|
33
|
+
x_2
|
|
34
|
+
\end{bmatrix}
|
|
35
|
+
\le 0,
|
|
36
|
+
\quad
|
|
37
|
+
A =
|
|
38
|
+
\begin{bmatrix}
|
|
39
|
+
1 & -1 \\[2pt]
|
|
40
|
+
-1 & -2
|
|
41
|
+
\end{bmatrix}.
|
|
42
|
+
\end{aligned}
|
|
43
|
+
\]
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
Returns:
|
|
47
|
+
Problem: the problem model.
|
|
48
|
+
"""
|
|
49
|
+
xs = TensorVariable(
|
|
50
|
+
name="x",
|
|
51
|
+
symbol="X",
|
|
52
|
+
variable_type=VariableTypeEnum.real,
|
|
53
|
+
shape=[2, 1],
|
|
54
|
+
lowerbounds=-5.0,
|
|
55
|
+
upperbounds=5.0,
|
|
56
|
+
initial_values=0.1,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
y = Variable(
|
|
60
|
+
name="y",
|
|
61
|
+
symbol="y",
|
|
62
|
+
variable_type=VariableTypeEnum.real,
|
|
63
|
+
lowerbound=-10.0,
|
|
64
|
+
upperbound=10.0,
|
|
65
|
+
initial_value=0.1,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
a = TensorConstant(name="A", symbol="A", shape=[2, 2], values=[[1.0, -1.0], [-1.0, -2.0]])
|
|
69
|
+
|
|
70
|
+
one = Constant(name="one", symbol="one", value=1.0)
|
|
71
|
+
|
|
72
|
+
f_1_expr = "X[1, 1]**2 + X[2, 1]**2 + y**2"
|
|
73
|
+
f_2_expr = "(X[1, 1] - 2)**2 + (X[2, 1] - one)**2 + (y - one)**2"
|
|
74
|
+
|
|
75
|
+
g_1_expr = "X[1, 1]**2 + X[2, 1] + y - 2"
|
|
76
|
+
big_g_expr = "A @ X"
|
|
77
|
+
|
|
78
|
+
f_1 = Objective(
|
|
79
|
+
name="f1",
|
|
80
|
+
symbol="f_1",
|
|
81
|
+
func=f_1_expr,
|
|
82
|
+
objective_type=ObjectiveTypeEnum.analytical,
|
|
83
|
+
ideal=0.0,
|
|
84
|
+
nadir=150.0,
|
|
85
|
+
is_twice_differentiable=True,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
f_2 = Objective(
|
|
89
|
+
name="f2",
|
|
90
|
+
symbol="f_2",
|
|
91
|
+
func=f_2_expr,
|
|
92
|
+
ideal=0.0,
|
|
93
|
+
nadir=206.0,
|
|
94
|
+
objective_type=ObjectiveTypeEnum.analytical,
|
|
95
|
+
is_twice_differentiable=True,
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
g_1 = Constraint(
|
|
99
|
+
name="g1", symbol="g_1", cons_type=ConstraintTypeEnum.LTE, func=g_1_expr, is_twice_differentiable=True
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
big_g = Constraint(
|
|
103
|
+
name="big_g",
|
|
104
|
+
symbol="G",
|
|
105
|
+
cons_type=ConstraintTypeEnum.LTE,
|
|
106
|
+
func=big_g_expr,
|
|
107
|
+
is_twice_differentiable=True,
|
|
108
|
+
is_linear=True,
|
|
109
|
+
is_convex=True,
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
return Problem(
|
|
113
|
+
name="Multi-valued-constraint problem",
|
|
114
|
+
description="Problem for testing problems with multi-valued constraints.",
|
|
115
|
+
constants=[a, one],
|
|
116
|
+
variables=[xs, y],
|
|
117
|
+
constraints=[g_1, big_g],
|
|
118
|
+
objectives=[f_1, f_2],
|
|
119
|
+
)
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
from desdeo.problem.schema import (
|
|
2
|
+
Objective,
|
|
3
|
+
ObjectiveTypeEnum,
|
|
4
|
+
Problem,
|
|
5
|
+
Variable,
|
|
6
|
+
VariableTypeEnum,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
def nimbus_test_problem() -> Problem:
|
|
10
|
+
r"""Defines the test problem utilized in the article describing Synchronous NIMBUS.
|
|
11
|
+
|
|
12
|
+
Defines the following multiobjective optimization problem:
|
|
13
|
+
|
|
14
|
+
\begin{align}
|
|
15
|
+
&\max_{\mathbf{x}} & f_1(\mathbf{x}) &= x_1 x_2\\
|
|
16
|
+
&\min_{\mathbf{x}} & f_2(\mathbf{x}) &= (x_1 - 4)^2 + x_2^2\\
|
|
17
|
+
&\min_{\mathbf{x}} & f_3(\mathbf{x}) &= -x_1 - x_2\\
|
|
18
|
+
&\min_{\mathbf{x}} & f_4(\mathbf{x}) &= x_1 - x_2\\
|
|
19
|
+
&\min_{\mathbf{x}} & f_5(\mathbf{x}) &= 50 x_1^4 + 10 x_2^4 \\
|
|
20
|
+
&\min_{\mathbf{x}} & f_6(\mathbf{x}) &= 30 (x_1 - 5)^4 + 100 (x_2 - 3)^4\\
|
|
21
|
+
&\text{s.t.,} && 1 \leq x_i \leq 3\quad i=\{1,2\},
|
|
22
|
+
\end{align}
|
|
23
|
+
|
|
24
|
+
with the following ideal point
|
|
25
|
+
$\mathbf{z}^\star = \left[9.0, 2.0, -6.0, -2.0, 60.0, 480.0 \right]$ and nadir point
|
|
26
|
+
$\mathbf{z}^\text{nad} = \left[ 1.0, 18.0, -2.0, 2.0, 4860.0, 9280.0 \right]$.
|
|
27
|
+
|
|
28
|
+
References:
|
|
29
|
+
Miettinen, K., & Mäkelä, M. M. (2006). Synchronous approach in
|
|
30
|
+
interactive multiobjective optimization. European Journal of Operational
|
|
31
|
+
Research, 170(3), 909–922. https://doi.org/10.1016/j.ejor.2004.07.052
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
Returns:
|
|
35
|
+
Problem: the NIMBUS test problem.
|
|
36
|
+
"""
|
|
37
|
+
variables = [
|
|
38
|
+
Variable(
|
|
39
|
+
name="x_1",
|
|
40
|
+
symbol="x_1",
|
|
41
|
+
variable_type=VariableTypeEnum.real,
|
|
42
|
+
initial_value=1.0,
|
|
43
|
+
lowerbound=1.0,
|
|
44
|
+
upperbound=3.0,
|
|
45
|
+
),
|
|
46
|
+
Variable(
|
|
47
|
+
name="x_2",
|
|
48
|
+
symbol="x_2",
|
|
49
|
+
variable_type=VariableTypeEnum.real,
|
|
50
|
+
initial_value=1.0,
|
|
51
|
+
lowerbound=1.0,
|
|
52
|
+
upperbound=3.0,
|
|
53
|
+
),
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
f_1_expr = "x_1 * x_2"
|
|
57
|
+
f_2_expr = "(x_1 - 4)**2 + x_2**2"
|
|
58
|
+
f_3_expr = "-x_1 - x_2"
|
|
59
|
+
f_4_expr = "x_1 - x_2"
|
|
60
|
+
f_5_expr = "50 * x_1**4 + 10 * x_2**4"
|
|
61
|
+
f_6_expr = "30 * (x_1 - 5)**4 + 100*(x_2 - 3)**4"
|
|
62
|
+
|
|
63
|
+
objectives = [
|
|
64
|
+
Objective(
|
|
65
|
+
name="Objective 1",
|
|
66
|
+
symbol="f_1",
|
|
67
|
+
func=f_1_expr,
|
|
68
|
+
maximize=True,
|
|
69
|
+
objective_type=ObjectiveTypeEnum.analytical,
|
|
70
|
+
ideal=9.0,
|
|
71
|
+
nadir=1.0,
|
|
72
|
+
is_convex=False,
|
|
73
|
+
is_linear=False,
|
|
74
|
+
is_twice_differentiable=True,
|
|
75
|
+
),
|
|
76
|
+
Objective(
|
|
77
|
+
name="Objective 2",
|
|
78
|
+
symbol="f_2",
|
|
79
|
+
func=f_2_expr,
|
|
80
|
+
maximize=False,
|
|
81
|
+
objective_type=ObjectiveTypeEnum.analytical,
|
|
82
|
+
ideal=2.0,
|
|
83
|
+
nadir=18.0,
|
|
84
|
+
is_convex=False,
|
|
85
|
+
is_linear=False,
|
|
86
|
+
is_twice_differentiable=True,
|
|
87
|
+
),
|
|
88
|
+
Objective(
|
|
89
|
+
name="Objective 3",
|
|
90
|
+
symbol="f_3",
|
|
91
|
+
func=f_3_expr,
|
|
92
|
+
maximize=False,
|
|
93
|
+
objective_type=ObjectiveTypeEnum.analytical,
|
|
94
|
+
ideal=-6.0,
|
|
95
|
+
nadir=-2.0,
|
|
96
|
+
is_convex=True,
|
|
97
|
+
is_linear=True,
|
|
98
|
+
is_twice_differentiable=True,
|
|
99
|
+
),
|
|
100
|
+
Objective(
|
|
101
|
+
name="Objective 4",
|
|
102
|
+
symbol="f_4",
|
|
103
|
+
func=f_4_expr,
|
|
104
|
+
maximize=False,
|
|
105
|
+
objective_type=ObjectiveTypeEnum.analytical,
|
|
106
|
+
ideal=-2.0,
|
|
107
|
+
nadir=2.0,
|
|
108
|
+
is_convex=True,
|
|
109
|
+
is_linear=True,
|
|
110
|
+
is_twice_differentiable=True,
|
|
111
|
+
),
|
|
112
|
+
Objective(
|
|
113
|
+
name="Objective 5",
|
|
114
|
+
symbol="f_5",
|
|
115
|
+
func=f_5_expr,
|
|
116
|
+
maximize=False,
|
|
117
|
+
objective_type=ObjectiveTypeEnum.analytical,
|
|
118
|
+
ideal=60.0,
|
|
119
|
+
nadir=4860.0,
|
|
120
|
+
is_convex=False,
|
|
121
|
+
is_linear=False,
|
|
122
|
+
is_twice_differentiable=True,
|
|
123
|
+
),
|
|
124
|
+
Objective(
|
|
125
|
+
name="Objective 6",
|
|
126
|
+
symbol="f_6",
|
|
127
|
+
func=f_6_expr,
|
|
128
|
+
maximize=False,
|
|
129
|
+
objective_type=ObjectiveTypeEnum.analytical,
|
|
130
|
+
ideal=480.0,
|
|
131
|
+
nadir=9280.0,
|
|
132
|
+
is_convex=False,
|
|
133
|
+
is_linear=False,
|
|
134
|
+
is_twice_differentiable=True,
|
|
135
|
+
),
|
|
136
|
+
]
|
|
137
|
+
|
|
138
|
+
return Problem(
|
|
139
|
+
name="NIMBUS test problem",
|
|
140
|
+
description="The test problem used in the Synchronous NIMBUS article",
|
|
141
|
+
variables=variables,
|
|
142
|
+
objectives=objectives,
|
|
143
|
+
)
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
from desdeo.problem.schema import (
|
|
2
|
+
Constraint,
|
|
3
|
+
ConstraintTypeEnum,
|
|
4
|
+
DiscreteRepresentation,
|
|
5
|
+
Objective,
|
|
6
|
+
ObjectiveTypeEnum,
|
|
7
|
+
Problem,
|
|
8
|
+
Variable,
|
|
9
|
+
VariableTypeEnum,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
def pareto_navigator_test_problem() -> Problem:
|
|
13
|
+
r"""Defines the problem utilized in the (convex) Pareto navigator article.
|
|
14
|
+
|
|
15
|
+
The problem is defined as follows:
|
|
16
|
+
|
|
17
|
+
\begin{align}
|
|
18
|
+
&\min_{\mathbf{x}} & f_1(\mathbf{x}) & = -x_1 - x_2 + 5 \\
|
|
19
|
+
&\min_{\mathbf{x}} & f_2(\mathbf{x}) & = 0.2(x_1^2 -10x_1 + x_2^2 - 4x_2 + 11) \\
|
|
20
|
+
&\min_{\mathbf{x}} & f_3(\mathbf{x}) & = (5 - x_1)(x_2 - 11)\\
|
|
21
|
+
&\text{s.t.,} & 3x_1 + x_2 - 12 & \leq 0,\\
|
|
22
|
+
& & 2x_1 + x_2 - 9 & \leq 0,\\
|
|
23
|
+
& & x_1 + 2x_2 - 12 & \leq 0,\\
|
|
24
|
+
& & 0 \leq x_1 & \leq 4,\\
|
|
25
|
+
& & 0 \leq x_2 & \leq 6.
|
|
26
|
+
\end{align}
|
|
27
|
+
|
|
28
|
+
The problem comes with seven pre-defined Pareto optimal solutions that were
|
|
29
|
+
utilized in the original article as well. From these, the ideal and nadir
|
|
30
|
+
points of the problem are approximated also.
|
|
31
|
+
|
|
32
|
+
References:
|
|
33
|
+
Eskelinen, P., Miettinen, K., Klamroth, K., & Hakanen, J. (2010). Pareto
|
|
34
|
+
navigator for interactive nonlinear multiobjective optimization. OR
|
|
35
|
+
Spectrum, 32(1), 211-227.
|
|
36
|
+
"""
|
|
37
|
+
x_1 = Variable(name="x_1", symbol="x_1", variable_type=VariableTypeEnum.real, lowerbound=0, upperbound=4)
|
|
38
|
+
x_2 = Variable(name="x_2", symbol="x_2", variable_type=VariableTypeEnum.real, lowerbound=0, upperbound=6)
|
|
39
|
+
|
|
40
|
+
f_1 = Objective(
|
|
41
|
+
name="f_1",
|
|
42
|
+
symbol="f_1",
|
|
43
|
+
func="-x_1 - x_2 + 5",
|
|
44
|
+
objective_type=ObjectiveTypeEnum.analytical,
|
|
45
|
+
ideal=-2.0,
|
|
46
|
+
nadir=5.0,
|
|
47
|
+
maximize=False,
|
|
48
|
+
)
|
|
49
|
+
f_2 = Objective(
|
|
50
|
+
name="f_2",
|
|
51
|
+
symbol="f_2",
|
|
52
|
+
func="0.2*(x_1**2 - 10*x_1 + x_2**2 - 4*x_2 + 11)",
|
|
53
|
+
objective_type=ObjectiveTypeEnum.analytical,
|
|
54
|
+
ideal=-3.1,
|
|
55
|
+
nadir=4.60,
|
|
56
|
+
maximize=False,
|
|
57
|
+
)
|
|
58
|
+
f_3 = Objective(
|
|
59
|
+
name="f_3",
|
|
60
|
+
symbol="f_3",
|
|
61
|
+
func="(5 - x_1) * (x_2 - 11)",
|
|
62
|
+
objective_type=ObjectiveTypeEnum.analytical,
|
|
63
|
+
ideal=-55.0,
|
|
64
|
+
nadir=-14.25,
|
|
65
|
+
maximize=False,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
con_1 = Constraint(name="g_1", symbol="g_1", func="3*x_1 + x_2 - 12", cons_type=ConstraintTypeEnum.LTE)
|
|
69
|
+
con_2 = Constraint(name="g_2", symbol="g_2", func="2*x_1 + x_2 - 9", cons_type=ConstraintTypeEnum.LTE)
|
|
70
|
+
con_3 = Constraint(name="g_3", symbol="g_3", func="x_1 + 2*x_2 - 12", cons_type=ConstraintTypeEnum.LTE)
|
|
71
|
+
|
|
72
|
+
representation = DiscreteRepresentation(
|
|
73
|
+
variable_values={"x_1": [0, 0, 0, 0, 0, 0, 0], "x_2": [0, 0, 0, 0, 0, 0, 0]},
|
|
74
|
+
objective_values={
|
|
75
|
+
"f_1": [-2.0, -1.0, 0.0, 1.38, 1.73, 2.48, 5.0],
|
|
76
|
+
"f_2": [0.0, 4.6, -3.1, 0.62, 1.72, 1.45, 2.2],
|
|
77
|
+
"f_3": [-18.0, -25.0, -14.25, -35.33, -38.64, -42.41, -55.0],
|
|
78
|
+
},
|
|
79
|
+
non_dominated=True,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
return Problem(
|
|
83
|
+
name="The (convex) Pareto navigator problem.",
|
|
84
|
+
description="The test problem used in the (convex) Pareto navigator paper.",
|
|
85
|
+
variables=[x_1, x_2],
|
|
86
|
+
objectives=[f_1, f_2, f_3],
|
|
87
|
+
constraints=[con_1, con_2, con_3],
|
|
88
|
+
discrete_representation=representation,
|
|
89
|
+
)
|