jMetalPy: A Python framework for multi-objective optimization with metaheuristics

https://doi.org/10.1016/j.swevo.2019.100598Get rights and content

Abstract

This paper describes jMetalPy, an object-oriented Python-based framework for multi-objective optimization with metaheuristic techniques. Building upon our experiences with the well-known jMetal framework, we have developed a new multi-objective optimization software platform aiming not only at replicating the former one in a different programming language, but also at taking advantage of the full feature set of Python, including its facilities for fast prototyping and the large amount of available libraries for data processing, data analysis, data visualization, and high-performance computing. As a result, jMetalPy provides an environment for solving multi-objective optimization problems focused not only on traditional metaheuristics, but also on techniques supporting preference articulation, constrained and dynamic problems, along with a rich set of features related to the automatic generation of statistical data from the results generated, as well as the real-time and interactive visualization of the Pareto front approximations produced by the algorithms. jMetalPy offers additionally support for parallel computing in multicore and cluster systems. We include some use cases to explore the main features of jMetalPy and to illustrate how to work with it.

Introduction

Multi-objective optimization problems are widely found in many disciplines [1,2], including engineering, economics, logistics, transportation or energy, among others. They are characterized by having two or more conflicting objective functions that have to be maximized or minimized at the same time, with their optimum composed by a set of trade-off solutions known as Pareto optimal set. Besides having several objectives, other factors can make this family of optimization problems particularly difficult to tackle and solve with exact techniques, such as deceptiveness, epistasis, NP-hard complexity, or high dimensionality [3]. As a consequence, the most popular techniques to deal with complex multi-objective optimization problems are metaheuristics [4], a family of non-exact algorithms including evolutionary algorithms and swarm intelligence methods (e.g. ant colony optimization or particle swarm optimization).

An important factor that has ignited the widespread adoption of metaheuristics is the availability of software tools easing their implementation, execution and deployment in practical setups. In the context of multi-objective optimization, one of the most acknowledged frameworks is jMetal [5], a project started in 2006 that has been continuously evolving since then, including a full redesign from scratch in 2015 [6]. jMetal is implemented in Java under the MIT licence, and its source code is publicly available in GitHub.1

In this paper, we present jMetalPy, a new multi-objective optimization framework written in Python. Our motivation for developing jMetalPy stems from our past experience with jMetal and from the fact that nowadays Python has become a very prominent programming language with a plethora of interesting features, which enables fast prototyping fueled by its large ecosystem of libraries for numerical and scientific computing (NumPy [7], Scipy [8]), data analysis (Pandas), machine learning (Scikit-learn [9]), visualization (Matplotlib [10], Plotly [11]), large-scale processing (Dask [12], PySpark [13]) and so forth. Our goal is not only to rewrite jMetal in Python, but to focus mainly on aspects where Python can help fill the gaps not covered by Java. In particular, we place our interest in the analysis of results provided by the optimization algorithms, real-time and interactive visualization, preference articulation for supporting decision making, and solving constrained and dynamic problems. Furthermore, since Python can be thought of as a more agile programming environment for prototyping new multi-objective solvers, jMetalPy also incorporates a full suite of statistical significance tests and related tools for the sake of a principled comparison among multi-objective metaheuristics.

jMetalPy has been developed by Computer Science engineers and scientists to support research in multi-objective optimization with metaheuristics, and to utilize the provided algorithms for solving real-word problems.

Following the same open source philosophy as in jMetal, jMetalPy is released under the MIT license. The project is in continuous development, with its source code hosted in GitHub,2 where the last stable and current development versions can be freely obtained.

The main features of jMetalPy are summarized as follows:

  • jMetalPy is implemented in Python (version 3.6+), and its object-oriented architecture makes it flexible and extensible.

  • It provides a set of representative multi-objective metaheuristics of the state-of-the-art (including NSGA-II [14], NSGA-III [15], GDE3 [16], SMPSO [17], OMOPSO [18], MOCell [19], IBEA [20], SPEA2 [21], HypE [22], MOEA/D-DE [23], MOEA/D-DRA [24]) and standard families of problems for benchmarking (ZDT [25], DTLZ [26], WFG [2], and LZ09 [27]).

  • Most of the included algorithms can solve classical benchmark constrained problems using the constraint handling approach applied in NSGA-II. Furthermore, recent proposals, such as the MOEA/D-IEpsilon algorithm and the LIR-CMOP test suite [28], are also included.

  • Dynamic multi-objective optimization is supported, including the implementation of dynamic versions of NSGA-II and SMPSO, as well as the FDA [29] problem family.

  • Reference point based preference articulation algorithms, such as SMPSO/RP [30] and versions of NSGA-II and GDE3, are also provided.

  • It implements quality indicators for multi-objective optimization, such as Hypervolume [31], Additive Epsilon [32] and Inverted Generational Distance [33].

  • It provides visualization components to display the Pareto front approximations when solving problems with two objectives (scatter plot), three objectives (scatter plot 3D), and many-objective problems (parallel coordinates graph and a tailored version of Chord diagrams).

  • Support for comparative studies, including a wide number of statistical tests and utilities (e.g. non-parametric test, post-hoc tests, boxplots, CD plot), including the automatic generation of LATEX tables (mean, standard deviation, median, interquartile range) and figures in different formats.

  • jMetalPy can cooperatively work alongside with jMetal. The latter can be used to run algorithms and compute the quality indicators, while the post-processing data analysis can be carried out with jMetalPy.

  • Parallel computing is supported based on Apache Spark [34] and Dask [12]. This includes an evaluator component that can be used by generational metaheuristics to evaluate solutions in parallel with Spark (synchronous parallelism), as well as a parallel version of NSGA-II based on Dask (asynchronous parallelism).

  • Supporting documentation. A website3 is maintained with user manuals and API specification for developers. This site also contains a series of Jupyter notebooks4 with use cases and examples of experiments and visualizations.

Our purpose of this paper is to describe jMetalPy, and to illustrate how it can be used by members of the community interested in experimenting with metaheuristics for solving multi-objective optimization problems. To this end, we include some implementation use cases based on NSGA-II to explore the main variants considered in jMetalPy, from standard versions (generational and steady state), to dynamic, reference-point based, parallel and distributed flavors of this solver. A experimental use case is also described to exemplify how the statistical tests and visualization tools included in jMetalPy can be used for post-processing and analyzing the obtained results in depth. For background concepts and formal definitions of multi-objective optimization, we refer to our previous work in Ref. [5].

The remaining of this paper is organized as follows. In Section 2, a review of relevant related algorithmic software platforms is conducted to give an insight and rationale of the main differences and contribution of jMetalPy. Section 3 delves into the jMetalPy architecture and its main components. Section 4 explains a use case of implementation. Visualization facilities are described in Section 5, while a use case of experimentation with statistical procedures is explained in Section 6. Finally, Section 7 presents the conclusions and outlines further related work planned for the near future.

Section snippets

Related works

In the last two decades, a number of software frameworks devoted to the implementation of multi-objective metaheuristics has been contributed to the community, such as ECJ [41], EvA [42], JCLEC-MO [43], jMetal [5,6], MOEA Framework [44], and Opt4J [45], which are written in Java; ParadisEO-MOEO [46], and PISA [47], developed in C/C++; and PlatEMO [48], implemented in Matlab. They all have in common the inclusion of representative algorithms from the state of the art, benchmark problems and

Architecture of jMetalPy

The architecture of jMetalPy has an object-oriented design to make it flexible and extensible (see Fig. 1). The core classes define the basic functionality of jMetalPy: an Algorithm solves a Problem by using some Operator entities which manipulate a set of Solution objects. We detail these classes next.

Implementation use case: NSGA-II and variants

With the aim of illustrating the basic usages of jMetalPy, in this section we describe the implementation of the well-known NSGA-II algorithm [14], as well as some of its variants (steady-state, dynamic, with preference articulation, parallel, and distributed).

NSGA-II is a genetic algorithm, which is a subclass of Evolutionary Algorithms. In jMetalPy we include an abstract class for the latter, and a default implementation for the former. An Evolutionary Algorithm is a metaheuristic where the

Visualization

An advantage of using Python (instead of Java) is its power related to visualization features thanks to the availability of graphic plotting libraries, such as Matplotlib or Plotly.

jMetalPy harnesses these libraries to include three types of visualization charts: static, interactive and streaming. Table 2 summarizes these implementations. Static charts can be shown in the screen, stored in a file, or included in a Jupyter notebook (typically used at the end of the execution of an algorithm).

Experimental use case

In previous sections, we have shown examples of Pareto front approximations produced by some of the metaheuristics included in jMetalPy. In this section, we describe how our framework can be used to carry out rigorous experimental studies based on comparing a number of algorithms to determine which of them presents the best overall performance.

Conclusions and future work

In this paper we have presented jMetalPy, a Python-based framework for multi-objective optimization with metaheuristics. It is released under the MIT license and made freely available for the community in GitHub. We have detailed its core architecture and described the implementation of NSGA-II and some of its variants as illustrative examples of how to operate with this framework.

jMetalPy provides support for dynamic optimization, parallelism, and decision making. Other salient features

Acknowledgements

This work has been partially funded by Grants TIN2017-86049-R (Spanish Ministry of Education and Science). José García-Nieto is the recipient of a Post-Doctoral fellowship of “Captación de Talento para la Investigación” Plan Propio at Universidad de Málaga. Javier Del Ser and Izaskun Oregui receive funding support from the Basque Government through the EMAITEK Program (Spain).

References (54)

  • J.J. Durillo et al.

    jmetal: a java framework for multi-objective optimization

    Adv. Eng. Software

    (2011)
  • J. Molina et al.

    Reference point based dominance for multiobjective metaheuristics

    Eur. J. Oper. Res.

    (2009)
  • C.A.C. Coello et al.

    Evolutionary Algorithms for Solving Multi-Objective Problems (Genetic and Evolutionary Computation)

    (2006)
  • K. Deb

    Multi-Objective Optimization Using Evolutionary Algorithms

    (2001)
  • T. Weise et al.

    Why is optimization difficult?

  • C. Blum et al.

    Metaheuristics in combinatorial optimization: overview and conceptual comparison

    ACM Comput. Surv.

    (2003)
  • A. Nebro et al.

    Redesigning the jmetal multi-objective optimization framework

  • T. Oliphant

    NumPy: A Guide to NumPy

    (2006)
  • E. Jones et al.

    SciPy: Open Source Scientific Tools for Python

    (2001)
  • F. Pedregosa et al.

    Scikit-learn: machine learning in Python

    J. Mach. Learn. Res.

    (2011)
  • J.D. Hunter

    Matplotlib: a 2d graphics environment

    Comput. Sci. Eng.

    (2007)
  • P.T.Inc

    Collaborative data science

  • Dask Development Team

    Dask: library for dynamic task scheduling

  • S. Salloum et al.

    Big data analytics on Apache spark

    International Journal of Data Science and Analytics

    (2016)
  • K. Deb et al.

    A fast and elitist multiobjective genetic algorithm: NSGA-II

    IEEE Trans. Evol. Comput.

    (2002)
  • K. Deb et al.

    An evolutionary many-objective optimization algorithm using reference-point-based nondominated sorting approach, part i: solving problems with box constraints

    IEEE Trans. Evol. Comput.

    (2014)
  • S. Kukkonen et al.

    GDE3: the third evolution step of generalized differential evolution

  • A.J. Nebro et al.

    SMPSO: a new PSO-based metaheuristic for multi-objective optimization

  • C.A.C. Coello et al.

    Handling multiple objectives with particle swarm optimization

    IEEE Trans. Evol. Comput.

    (2004)
  • A.J. Nebro et al.

    MOCell: a cellular genetic algorithm for multiobjective optimization

    Int. J. Intell. Syst.

    (2009)
  • E. Zitzler et al.

    Indicator-based selection in multiobjective search

  • E. Zitzler et al.

    SPEA2: improving the strength pareto evolutionary algorithm

  • J. Bader et al.

    HypE: an Algorithm for Fast Hypervolume-Based Many-Objective Optimization, TIK Report 286, Computer Engineering and Networks Laboratory (TIK)

    (Nov. 2008)
  • Q. Zhang et al.

    MOEA/D: a multiobjective evolutionary algorithm based on decomposition

    IEEE Trans. Evol. Comput.

    (2007)
  • Q. Zhang et al.

    The Performance of a New Version of Moea/d on Cec09 Unconstrained Mop Test Instances

    (2009)
  • E. Zitzler et al.

    Comparison of multiobjective evolutionary algorithms: empirical results

    Evol. Comput.

    (2000)
  • K. Deb et al.

    Scalable test problems for evolutionary multiobjective optimization

  • Cited by (153)

    • Evolutionary swarm formation: From simulations to real world robots

      2024, Engineering Applications of Artificial Intelligence
    View all citing articles on Scopus
    View full text