utilities.polytopes
Module which handles polytopes.
Module Contents
Functions
|
Check if a polytope is inherently nondominated: |
|
Check if polytope p(k1) dominates polytope p(k2) with epsilon certainty |
|
Generate polytopes from an array of indices which form simplices |
- utilities.polytopes.inherently_nondominated(A: numpy.ndarray, epsilon: float | None = 1e-06, method: str | None = 'highs') bool [source]
Check if a polytope is inherently nondominated: A polytope is inherently nondominated iff the polytope does not dominate itself.
- Parameters:
A (np.ndarray) – A polytope to be checked.
epsilon (Optional[float], optional) – precision parameter, see polytope_dominates for further details. Defaults to 1e-6.
method (Optional[str], optional) – Algorithm used to solve the optimization problems. Defaults to ‘highs’.
- Returns:
is the given set inherently nondominated.
- Return type:
bool
- utilities.polytopes.polytope_dominates(k1: numpy.ndarray, k2: numpy.ndarray, epsilon: float | None = 1e-06, method: str | None = 'highs') bool [source]
Check if polytope p(k1) dominates polytope p(k2) with epsilon certainty by solving linear optimization problems [min_x c^T*x] using linprog from scipy.optimize.
- Parameters:
k1 (np.ndarray) – Corners of first polytope
k2 (np.ndarray) – Corners of seconds polytope
epsilon (Optional[float], optional) – precision parameter. Defaults to 1e-6
method (Optional[str], optional) – Algorithm used to solve the optimization problems. Defaults to ‘highs’. See scipy.optimize.linprog for further details.
- Returns:
Does polytope p(k1) dominate polytope p(k2).
- Return type:
bool
- utilities.polytopes.generate_polytopes(simplices: numpy.ndarray) numpy.ndarray [source]
Generate polytopes from an array of indices which form simplices
- Parameters:
arr (np.ndarray) – An array of indices which form simplices. In PAINT this is the array of simplices which form the Delaunay triangulation.
- Returns
- np.ndarray: An array of indices which form the polytopes
that are generated from the given array. If a polytope has fewer outcomes than there are columns in the given array the first value of the row representing the polytope is repeated until the lengths match.