Polytope evaluation algorithms
There are three methods implemented in this paper to resolve all the polytope calculations:
Hyper-plane shifting method (HPSM)
Iterative convex hull method (ICHM)
Vertex enumeration (VEPOLI2)
All of the methods are implemented in the module pycapacity.algorithms and can be used as standalone functions, see pycapacity.algorithms. All of them also have a C++ implementation in the optional compiled backend, see C++ acceleration. The page Comparison with other methods compares them with the usual alternatives (Qhull, DDM, Bretl and Lall).
Hyper-plane shifting method (HPSM)
This method finds the half-space representation of the polytope of a class:
To find the vertices of the polytope after finding the half-space representation \(Hx \leq d\) an convex-hull algorithm is used.
The method is a part of the pycapacity.algorithms module hyper_plane_shift_method, See in docs for more info
Iterative convex-hull method (ICHM)
This method finds both vertex and half-space representation of the class of polytopes:
And it can be additionally extended to the case where there is an additional projection matrix $P$ making a class of problems:
The method is a part of the pycapacity.algorithms module iterative_convex_hull_method. See the docs for more info
Vertex enumeration algorithm (VEPOLI2)
This method finds vertex representation of the class of polytopes:
To find the half-space representation (faces) of the polytope after finding the vertex representation an convex-hull algorithm is used.
The method is a part of the pycapacity.algorithms module vertex_enumeration_vepoli2. See the docs for more info
Performance evaluation of polytope metrics
The applicable methods to evaluate different polytope based metrics depend on the family of problems they correspond to. Therefore this section brings the information about which algorithm is used for which polytope metric and provides a brief performance evaluation their execution times.
The C++ column is the optional compiled backend pycapacity-cpp (see C++ acceleration); pycapacity uses it automatically when it is installed, with the same functions and results.
Polytope metric |
Algorithm |
Problem type |
Python [ms] |
C++ [ms] |
|---|---|---|---|---|
Velocity |
HPSM |
\(x=By,~ y \in [y_{min}, y_{max}]\) |
1.43 \(\pm\) 0.06 (2.7) |
0.20 \(\pm\) 0.20 (6.4) |
Acceleration |
HPSM |
\(x=By,~ y \in [y_{min}, y_{max}]\) |
2.24 \(\pm\) 0.08 (2.5) |
0.38 \(\pm\) 0.01 (0.60) |
Force |
VEPOLI2 |
\(Ax=b,~ b \in [b_{min}, b_{max}]\) |
2.39 \(\pm\) 0.28 (9.1) |
0.046 \(\pm\) 0.006 (0.12) |
Force intersection |
VEPOLI2 |
\(Ax=b,~ b \in [b_{min}, b_{max}]\) |
27.5 \(\pm\) 2.5 (31.0) |
1.39 \(\pm\) 0.22 (1.71) |
Force sum |
VEPOLI2 |
\(Ax=b,~ b \in [b_{min}, b_{max}]\) |
5.04 \(\pm\) 0.35 (10.0) |
0.35 \(\pm\) 0.08 (0.73) |
Reachable space |
ICHM |
\(x=By,~ y \in P_{y}\) |
4.57 \(\pm\) 5.08 (117.8) |
0.69 \(\pm\) 0.07 (1.33) |
The execution times are calculated using the 7 dof Franka Emika Panda robot (pinocchio and robot_descriptions), over 1000 random configurations (100 for the force intersection),
with the benchmarking script provided in the examples folder, script link.
In case of human musculoskeletal models the methods used are given in the table below.
Polytope metric |
Algorithm |
Problem type |
Python [ms] |
C++ [ms] |
|---|---|---|---|---|
Force |
ICHM |
\(Ax=By,~ y \in [y_{min}, y_{max}]\) |
31.7 \(\pm\) 9.8 (51.4) |
1.20 \(\pm\) 0.98 (7.8) |
Acceleration |
HPSM (or ICHM) |
\(x=By,~ y \in [y_{min}, y_{max}]\) |
96.2 \(\pm\) 2.5 (110.8) |
10.4 \(\pm\) 0.9 (16.5) |
Velocity |
ICHM |
\(x=By,~ y \in P_{y}\) |
53.3 \(\pm\) 16.3 (94.4) |
1.81 \(\pm\) 0.53 (3.9) |
The execution times are calculated using the 50 muscle 7 dof musculoskeletal model introduced by Holzbaur (MOBL-ARMS) with the biorbd biomechanics software, over 50 random configurations,
with the benchmarking script provided in the examples folder, script link.
All the times are measured on a computer with an Intel i7-12850HX processor, Python 3.11 and the default settings (the times of the human acceleration polytope are with HPSM).
As these times can vary significantly depending on the complexity of the model used and the hardware it is run on,
the users are encouraged to run the benchmark scripts themselves to get the most accurate results.
This package provides several benchmarking scripts in the examples folder, see link for more
details: link.