A PyTorch implementation of Falcón-Cardona and Coello Coello's iMOACOR, an indicator-based many-objective ant colony optimization algorithm for continuous search spaces. The original journal article is available for purchase here, while an older version is available to view here.
During the development of this project, a strong emphasis was placed on obtaining runtime performance similar to that of the original C implementation, which has been achieved – even when using only 1 CPU core. While this implementation's operation and behaviour differ slightly, the resulting Pareto optimal fronts are similar.
- Python3.5+
- Numpy
- PyTorch v1.0+: Due to the current limitations of the JIT-compiler's tracing approach, some techniques were implemented that are not compatible with the previous versions of PyTorch. Note that GPU-acceleration is not leveraged, as this problem type would likely not benefit from it.
Run with the following command:
python3 iMOACOR.py <path to configuration file> [OPTIONS]
Options:
-r N | --runs=N: The number of runs to execute-s NAME | --scal=NAME: Use the scalarization method named NAME--snapshots: Write generational snapshots to thesnapshotsfolder-h | --help: Display the help page and exit
All configurations are included within the config folder.
Currently, the scalarization functions ASF (Achievement Scalarization Function) and VADS (Vector Angle Distance Scaling) are implemented.
By default, 1 run is executed using ASF.
For each run, the resulting Pareto optimal set and Pareto optimal front are written to a subfolder of the output folder.
Currently, only the DTLZ test suite is implemented.
The table below compares the optimization performance of the C implementation against the PyTorch implementation, noting the scalarization function used. All experiments were run 30 times and used the same configurations. DTLZ2 and DTLZ4 results were similar for all, while the PyTorch implementation generally fares slightly better in DTLZ5 and DTLZ6. For DTLZ7, PyTorch with ASF performs better than C with ASF, although PyTorch with VADS performs drastically worse; this demonstrates the impact that the choice of scalarization may make.
A greater Hypervolume is better.
| Problem | Dims | C - ASF | PyTorch - ASF | PyTorch - VADS |
|---|---|---|---|---|
| DTLZ2 | 3 | 7.420231e+00(2.561e–04) | 7.420099e+00(2.640e–04) | 7.421886e+00(3.897e–04) |
| 5 | 3.165018e+01(2.529e–03) | 3.165292e+01(1.654e–03) | 3.166400e+01(4.713e–03) | |
| 7 | 1.277012e+02(7.756e–03) | 1.277236e+02(6.245e–03) | 1.276529e+02(1.478e–01) | |
| DTLZ4 | 3 | 7.419261e+00(9.233e–04) | 7.418391e+00(1.030e–03) | 7.398056e+00(9.607e–02) |
| 5 | 3.163519e+01(3.624e–03) | 3.163822e+01(2.656e–03) | 3.163021e+01(7.057e–02) | |
| 7 | 1.277266e+02(7.245e–03) | 1.277303e+02(4.940e–03) | 1.276833e+02(8.943e–02) | |
| DTLZ5 | 3 | 5.983806e+01(7.194e–03) | 5.983627e+01(1.014e–02) | 5.981663e+01(1.434e–02) |
| 5 | 9.372627e+02(9.321e–01) | 9.445540e+02(1.338e+00) | 9.423998e+02(2.317e+00) | |
| 7 | 1.444221e+04(1.115e+02) | 1.490116e+04(4.437e+01) | 1.490963e+04(5.938e+01) | |
| DTLZ6 | 3 | 1.315942e+03(1.175e+00) | 1.316013e+03(1.066e+00) | 1.316235e+03(2.011e+00) |
| 5 | 1.563606e+05(1.388e+03) | 1.547633e+05(1.130e+03) | 1.578140e+05(1.681e+03) | |
| 7 | 1.801024e+07(2.869e+05) | 1.850276e+07(1.912e+05) | 1.897912e+07(3.123e+05) | |
| DTLZ7 | 3 | 1.624747e+01(3.431e–02) | 1.632806e+01(5.579e–03) | 2.457880e+00(2.604e+00) |
| 5 | 1.256712e+01(8.935e–02) | 1.289479e+01(2.891e–02) | 1.602372e–01(3.348e–01) | |
| 7 | 8.283139e+00(2.093e–01) | 8.810581e+00(9.006e–02) | 3.675018e–03(4.040e–03) |
Below are GIFs created from the results through the use of two of my other projects, Hypervolume Manager and Pareto Set Plotter.
Shown are the n-dimensional spatial positions for each of the best solutions created up until the current generation, as determined by the R2-ranking algorithm.
Each bar represents one spatial dimension for the solutions, with positional values ranging from 0 → 1 from bottom to top.
Each solution is drawn starting at a nest node and traverses through each dimension from left to right.
The colour of a solution is determined by its rank relative to other solutions, with the greenest solutions being the lowest of rank, and the bluest solutions being the highest of rank; a solution of rank 1 means that it is nondominated, as in there exists no other current solution that is more optimal in all k objective functions.

