Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions docs/reference/problems.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Choose a problem by its **formulation, encoding and dimensions**, then check the
[algorithm compatibility matrix](algorithms.md). This catalog describes the
251 registered problems in VAMOS **1.4.0**; **Development after 1.4.0:**
CTP1–CTP7 bring them to 258. The named selection helpers are
CTP1–CTP7 bring them to 258, and IDTLZ1 and IDTLZ2 to 260. The named selection helpers are
[stable public APIs](../project/stability-and-versioning.md). A synthetic or
engineering benchmark is a test model, not a validated model of your application.

Expand Down Expand Up @@ -44,9 +44,9 @@ a whole family and take the variant number and the family's parameters:
`DASCMOP`, `DCDTLZ`, and `LIRCMOP`. **Development after 1.4.0:** `CTP`
covers CTP1–CTP7 in the same way. Every registered problem, including the
families and members without a class (ZDT5, DTLZ5 and DTLZ6, UF4–UF10, LZ09,
MW, C-DTLZ, LSMOP, ZCAT, RE, and RWA), is available by name through
`optimize("name")` and `make_problem_selection`, the stable way to build any
of them.
MW, C-DTLZ, LSMOP, ZCAT, RE, and RWA; **Development after 1.4.0:** IDTLZ1
and IDTLZ2), is available by name through `optimize("name")` and
`make_problem_selection`, the stable way to build any of them.

**VAMOS 1.3.0:** some registered problems also take options
besides `n_var` and `n_obj`: `capacity_ratio` for `bin_knapsack`, and
Expand Down Expand Up @@ -83,6 +83,8 @@ the corresponding implementation or family registration in the 1.0.1 release.
| `dtlz1` | 7 | 3 | 0 | `n = M + 4` (`k = 5`) when n is omitted | [DTLZ][dtlz] | 2D and 3D; **Development after 1.4.0:** also 4D, 6D and 8D |
| `dtlz2`–`dtlz6` | 12 | 3 | 0 | `n = M + 9` (`k = 10`); DTLZ4 uses `alpha = 100` | [DTLZ][dtlz] | 2D and 3D, each; **Development after 1.4.0:** DTLZ2–DTLZ4 also 4D, 6D and 8D |
| `dtlz7` | 22 | 3 | 0 | `n = M + 19` (`k = 20`) | [DTLZ][dtlz] | 2D and 3D; **Development after 1.4.0:** also 4D, 6D and 8D |
| `idtlz1` | 7 | 3 | 0 | **Development after 1.4.0:** `n = M + 4` (`k = 5`) when n is omitted; DTLZ1's front turned over | [IDTLZ][idtlz] | 2D and 3D |
| `idtlz2` | 12 | 3 | 0 | **Development after 1.4.0:** `n = M + 9` (`k = 10`); DTLZ2's front turned over | [IDTLZ][idtlz] | 2D and 3D |
| `wfg1`–`wfg9` | 24 | 3 | 0 | `k = 4`, `l = 20`; bounds `[0, 2i]` for variable i | [WFG][wfg] | **2D only**, each |
| `lz09_f1`, `lz09_f7`, `lz09_f8` | 10 | 2 | 0 | Fixed M; family-specific linkage | [Li–Zhang LZ09][lz] | None packaged |
| `lz09_f2`–`lz09_f5`, `lz09_f9` | 30 | 2 | 0 | Fixed M; family-specific linkage | [Li–Zhang LZ09][lz] | None packaged |
Expand All @@ -92,6 +94,21 @@ the corresponding implementation or family registration in the 1.0.1 release.
| `lsmop1`–`lsmop9` | 300 | 3 | 0 | `nk = 5` subcomponents per group | [LSMOP][lsmop] | **2D only**, each |
| `zcat1`–`zcat20` | 30 | 2 | 0 | `level = 1`; complicated Pareto set, bias and imbalance all `False` | [ZCAT][zcat] | 2D, 3D, 4D and 6D, each |

**Development after 1.4.0:** IDTLZ1 and IDTLZ2 are the inverted DTLZ1 and
DTLZ2 of Jain and Deb (2014), the usual test of how decomposition-based
algorithms cope with an inverted front. They follow PlatEMO's `IDTLZ1` and
`IDTLZ2`: with DTLZ1's or DTLZ2's distance function `g` and position shape `s`
(DTLZ1 is `f = (1 + g) s / 2` and DTLZ2 `f = (1 + g) s`), IDTLZ1 is
`f = (1 + g) / 2 - (1 + g) s / 2` and IDTLZ2 `f = (1 + g) - (1 + g) s`. Every
objective is minimized. With `g = 0`, at the distance variables 0.5, the front
of IDTLZ1 is `(1 - w) / 2` and that of IDTLZ2 `1 - w / norm(w)`, for `w` on the
unit simplex: DTLZ1's simplex and DTLZ2's sphere turned over, so that many of
the evenly spread weight vectors of a decomposition point past it. With two objectives,
IDTLZ1's front is DTLZ1's segment `f1 + f2 = 0.5`. pymoo 0.6.2's
`InvertedDTLZ1` computes IDTLZ1 in the same way; pymoo has no inverted DTLZ2.
The classes are not exported by `vamos.problems`: build them by name. They
take `n_obj` as DTLZ does.

DTLZ, WFG, LSMOP and ZCAT allow changing `n_obj` in named selection. For DTLZ,
omitting `n_var` recalculates the standard dimension from M; setting a different
n is allowed but changes the experimental setting. For WFG, `k = 4` at M = 2,
Expand Down Expand Up @@ -711,6 +728,9 @@ compatibility or a certified optimum.
not use those two-column files for three-objective indicators.
- **Development after 1.4.0:** CTP1–CTP7 have two-objective samples,
`ctp1.csv` to `ctp7.csv`.
- **Development after 1.4.0:** IDTLZ1 and IDTLZ2 have samples with two and
three objectives, `idtlz1.2d.csv`, `idtlz1.3d.csv`, `idtlz2.2d.csv` and
`idtlz2.3d.csv`. Other values of M need a supplied reference.
- C-DTLZ, DC-DTLZ, ZCAT and ZXH-CF supply dimension-specific samples, named
`<key>.<M>d.csv`: at M = 2 and 3 for C-DTLZ and DC-DTLZ, at M = 2, 3, 4
and 6 for ZCAT, and at M = 3 for ZXH-CF. Other objective counts need a
Expand Down Expand Up @@ -748,6 +768,7 @@ regenerates the files marked as regenerated.
| `dtlz5`, `dtlz6` | Regenerated: 1000 points of the front curve |
| `dtlz7` | Regenerated: 5050 points of the disconnected front |
| `dtlz1.2d`–`dtlz7.2d` | **VAMOS 1.3.0:** regenerated, 1000 points spaced evenly along the front: `f1 + f2 = 0.5` (DTLZ1), the quarter circle (DTLZ2–DTLZ6; at M = 2, DTLZ5 and DTLZ6 do not degenerate) and the non-dominated pieces of `f2 = 4 - f1 (1 + sin(3 pi f1))` (DTLZ7) |
| `idtlz1`, `idtlz2`, `.2d` and `.3d` | **Development after 1.4.0:** generated as PlatEMO's `GetOptimum` defines them, `(1 - w) / 2` (IDTLZ1) and `1 - w / norm(w)` (IDTLZ2): at M = 2, 1000 points spaced evenly along the front (IDTLZ1's segment is DTLZ1's); at M = 3, the 5050-point simplex lattice of the DTLZ1–DTLZ4 samples |
| `dtlz1`, `dtlz2` and `dtlz7`, `.4d`, `.6d` and `.8d` | **Development after 1.4.0:** regenerated. DTLZ1 and DTLZ2 (which DTLZ3 and DTLZ4 share): the largest Das-Dennis simplex lattice with at most 10 000 points (H = 37, 13 and 8: 9880, 8568 and 6435 points), scaled to `sum(f) = 0.5` or projected onto the unit sphere. DTLZ7: its last objective is `2 (M - sum psi(f_i))` over the others, with `psi(t) = t (1 + sin(3 pi t))`, so the front is the product of the values of `f_i` that no smaller value beats in `psi`; values of a grid of 200 001 points, combined and thinned to 5050 points by farthest-point selection |
| `wfg1`, `wfg2` | Regenerated from the WFG shape functions, 10 000 points |
| `wfg3`–`wfg9` | Closed-form front, 10 000 points, unchanged |
Expand Down Expand Up @@ -910,6 +931,7 @@ scalable formulations. For a new objective function, follow
[cec2009-cf]: https://github.com/jMetal/jMetal/tree/1e4b83cae6/jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/cec2009
[zxh-cf]: https://doi.org/10.1109/TEVC.2020.3011829
[ctp]: https://doi.org/10.1007/3-540-44719-9_20
[idtlz]: https://doi.org/10.1109/TEVC.2013.2281534
[cre-paper]: https://doi.org/10.1016/j.asoc.2020.106078
[rcm-paper]: https://doi.org/10.1016/j.swevo.2021.100961
[jmetal-cre]: https://github.com/jMetal/jMetal/tree/1e4b83cae6/jmetal-problem/src/main/java/org/uma/jmetal/problem/multiobjective/cre
Expand Down
20 changes: 19 additions & 1 deletion experiments/scripts/generate_reference_fronts.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

- **Analytic samples** of the Pareto front from its closed form: ZDT1-4 and ZDT6, DTLZ1-7 (M = 3, and M = 2 as
``dtlz1.2d`` ... ``dtlz7.2d``; Development after 1.4.0: DTLZ1, DTLZ2 and DTLZ7 at M = 4, 6 and 8 as ``dtlz1.4d``
... ``dtlz7.8d``, DTLZ2's also serving DTLZ3 and DTLZ4), WFG1 and
... ``dtlz7.8d``, DTLZ2's also serving DTLZ3 and DTLZ4), IDTLZ1 and IDTLZ2 at M = 2 and 3 (Development after
1.4.0: ``idtlz1.2d`` ... ``idtlz2.3d``), WFG1 and
WFG2 (M = 2, from the WFG shape functions, so the bias transformations cannot shift them), LSMOP9 (M = 2),
CEC2009 UF6 and UF9, and the ten C-DTLZ and DC-DTLZ problems at M = 2 and 3 (``c1dtlz1.2d`` ...
``dc3dtlz3.3d``), Srinivas, ConstrEx and Tanaka from their Pareto-set pieces and constraint boundaries, ZXH-CF1-16 at
Expand Down Expand Up @@ -203,6 +204,22 @@ def _dtlz_two_objective(name: str) -> np.ndarray:
return np.column_stack([np.cos(theta), np.sin(theta)])


def _idtlz(name: str, m: int) -> np.ndarray:
"""Development after 1.4.0: the inverted DTLZ1 and DTLZ2 of Jain and Deb (2014), as PlatEMO's ``GetOptimum``.

IDTLZ1's front is ``(1 - w) / 2`` and IDTLZ2's ``1 - w / |w|``, for ``w`` on the unit simplex: with M = 2, 1000
points spaced evenly along the front, and with M = 3 the 5050-point simplex lattice of DTLZ1-DTLZ4's samples.
"""
if m == 2:
if name == "idtlz1":
f1 = np.linspace(0.0, 0.5, 1000)
return np.column_stack([f1, 0.5 - f1])
theta = np.linspace(0.0, np.pi / 2.0, 1000)
return np.column_stack([1.0 - np.cos(theta), 1.0 - np.sin(theta)])
w = simplex_lattice(m, 99)
return (1.0 - w) / 2.0 if name == "idtlz1" else 1.0 - w / np.linalg.norm(w, axis=1, keepdims=True)


# Development after 1.4.0: DTLZ1, DTLZ2 (whose sample DTLZ3 and DTLZ4 share) and DTLZ7 with more objectives.
MANY_OBJECTIVES = (4, 6, 8)
# Per objective count, the values per position objective of DTLZ7's candidate grid: about 10^5 candidates in all.
Expand Down Expand Up @@ -568,6 +585,7 @@ def constraint(f1: np.ndarray, f2: np.ndarray) -> np.ndarray:
**{name: (lambda name=name: _zdt(name)) for name in ("zdt1", "zdt2", "zdt3", "zdt4", "zdt6")},
**{f"dtlz{i}": (lambda i=i: _dtlz(f"dtlz{i}")) for i in range(1, 8)},
**{f"dtlz{i}.2d": (lambda i=i: _dtlz_two_objective(f"dtlz{i}")) for i in range(1, 8)},
**{f"idtlz{i}.{m}d": (lambda i=i, m=m: _idtlz(f"idtlz{i}", m)) for i in (1, 2) for m in (2, 3)},
**{f"dtlz{i}.{m}d": (lambda i=i, m=m: _dtlz_many_objective(f"dtlz{i}", m)) for i in (1, 2, 7) for m in MANY_OBJECTIVES},
"wfg1": lambda: _wfg("wfg1"),
"wfg2": lambda: _wfg("wfg2"),
Expand Down
76 changes: 76 additions & 0 deletions src/vamos/foundation/problem/dtlz.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,3 +302,79 @@ def _evaluate(self, X: np.ndarray[Any, Any], out: dict[str, np.ndarray[Any, Any]
out["F"][:] = F
else:
out["F"] = F


def _position_shape(head: np.ndarray[Any, Any], tail: np.ndarray[Any, Any]) -> np.ndarray[Any, Any]:
"""DTLZ's position shape, as PlatEMO writes it: ``fliplr(cumprod([1, head])) .* [1, fliplr(tail)]``.

``f_1 = h_1 ... h_{M-1}``, ``f_i = h_1 ... h_{M-i} t_{M-i+1}`` and ``f_M = t_1``: DTLZ1 takes ``h = x`` and
``t = 1 - x``, DTLZ2 ``h = cos(x pi / 2)`` and ``t = sin(x pi / 2)``, for the M - 1 position variables.
"""
ones = np.ones((head.shape[0], 1))
return np.asarray(np.cumprod(np.hstack([ones, head]), axis=1)[:, ::-1] * np.hstack([ones, tail[:, ::-1]]))


def _warn_non_standard_k(name: str, n_var: int, n_obj: int, standard: int) -> None:
k = n_var - n_obj + 1
if k != standard:
warnings.warn(
f"Non-standard {name} configuration: k={k} (standard k={standard}). "
f"Consider using n_var={n_obj + standard - 1} for standard benchmark.",
UserWarning,
stacklevel=3,
)


class IDTLZ1Problem(DTLZBase):
"""Inverted DTLZ1 (Jain and Deb, 2014), as PlatEMO's ``IDTLZ1``.

Development after 1.4.0: ``f = (1 + g) / 2 - (1 + g) / 2 * s``, where ``g`` is DTLZ1's distance function
and ``s`` its position shape (DTLZ1 is ``f = (1 + g) / 2 * s``). With ``g = 0`` the front is DTLZ1's
simplex turned over, ``f = (1 - w) / 2`` for ``w`` on the unit simplex. ``n_var`` defaults to
``n_obj + 4`` (k = 5).
"""

def __init__(self, n_var: int | None = None, n_obj: int = 3) -> None:
if n_var is None:
n_var = n_obj + 4
super().__init__(n_var, n_obj)
_warn_non_standard_k("IDTLZ1", n_var, n_obj, 5)

def _evaluate(self, X: np.ndarray[Any, Any], out: dict[str, np.ndarray[Any, Any]]) -> None:
m = self.n_obj
distance = X[:, m - 1 :] - 0.5
g = 100.0 * (self.n_var - m + 1 + np.sum(distance**2 - np.cos(20.0 * np.pi * distance), axis=1))
position = X[:, : m - 1]
scale = (1.0 + g)[:, None]
F = scale / 2.0 - 0.5 * scale * _position_shape(position, 1.0 - position)
if "F" in out and out["F"] is not None:
out["F"][:] = F
else:
out["F"] = F


class IDTLZ2Problem(DTLZBase):
"""Inverted DTLZ2 (Jain and Deb, 2014), as PlatEMO's ``IDTLZ2``.

Development after 1.4.0: ``f = (1 + g) - (1 + g) * s``, where ``g = sum (x_i - 0.5)^2`` over the distance
variables and ``s`` is DTLZ2's position shape (DTLZ2 is ``f = (1 + g) * s``). With ``g = 0`` the front is
the unit sphere's positive orthant turned over, ``f = 1 - u`` for ``u`` on it. ``n_var`` defaults to
``n_obj + 9`` (k = 10).
"""

def __init__(self, n_var: int | None = None, n_obj: int = 3) -> None:
if n_var is None:
n_var = n_obj + 9
super().__init__(n_var, n_obj)
_warn_non_standard_k("IDTLZ2", n_var, n_obj, 10)

def _evaluate(self, X: np.ndarray[Any, Any], out: dict[str, np.ndarray[Any, Any]]) -> None:
m = self.n_obj
g = np.sum((X[:, m - 1 :] - 0.5) ** 2, axis=1)
angle = X[:, : m - 1] * np.pi / 2.0
scale = (1.0 + g)[:, None]
F = scale - scale * _position_shape(np.cos(angle), np.sin(angle))
if "F" in out and out["F"] is not None:
out["F"][:] = F
else:
out["F"] = F
23 changes: 23 additions & 0 deletions src/vamos/foundation/problem/registry/families/dtlz.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
DTLZ5Problem,
DTLZ6Problem,
DTLZ7Problem,
IDTLZ1Problem,
IDTLZ2Problem,
)
from ..common import ProblemSpec

Expand Down Expand Up @@ -108,6 +110,27 @@ def get_specs() -> dict[str, ProblemSpec]:
description="DTLZ7 with disconnected Pareto-optimal regions.",
factory=lambda n_var, n_obj: _dtlz_factory(DTLZ7Problem, n_var, n_obj),
),
# Development after 1.4.0: the inverted DTLZ1 and DTLZ2 of Jain and Deb (2014), as PlatEMO's.
"idtlz1": ProblemSpec(
key="idtlz1",
label="IDTLZ1",
default_n_var=7,
default_n_obj=3,
allow_n_obj_override=True,
default_n_var_fn=_dtlz_k5_n_var,
description="Inverted DTLZ1 (Jain and Deb, 2014): DTLZ1's simplex front turned over (defaults to 3 objectives).",
factory=lambda n_var, n_obj: _dtlz_factory(IDTLZ1Problem, n_var, n_obj),
),
"idtlz2": ProblemSpec(
key="idtlz2",
label="IDTLZ2",
default_n_var=12,
default_n_obj=3,
allow_n_obj_override=True,
default_n_var_fn=_dtlz_k10_n_var,
description="Inverted DTLZ2 (Jain and Deb, 2014): DTLZ2's spherical front turned over (defaults to 3 objectives).",
factory=lambda n_var, n_obj: _dtlz_factory(IDTLZ2Problem, n_var, n_obj),
),
}
)
return SPECS
Expand Down
Loading