Problems in PyGMO are objects, first constructed and then used in conjunction to an algorithm. The user can implement its own problem directly in Python, in which case he needs to inherit from PyGMO.problem.base or PyGMO.problem.base_stochastic class. You may see Adding a new optimization problem or Adding a new stochastic optimization problem
Common Name | Name in PyGMO | Comments |
---|---|---|
Rotated | PyGMO.problem.rotated | |
Shifted | PyGMO.problem.shifted | |
Normalized | PyGMO.problem.normalized | |
Noisy | PyGMO.problem.noisy | |
Decompose | PyGMO.problem.decompose | |
Death-penalty | PyGMO.problem.death_penalty | Minimization assumed. |
Constrained to MO | PyGMO.problem.con2mo | |
Constrained to Unconstrained | PyGMO.problem.con2uncon |
Common Name | Name in PyGMO | Comments |
---|---|---|
Ackley | PyGMO.problem.ackley | |
Bukin F6 | PyGMO.problem.bukin | A difficult bi-dimensional problem |
Branin | PyGMO.problem.branin | Bi-dimensional problem |
CEC2013 | PyGMO.problem.cec2013 | 28 problems part of CEC2013 Competition |
De Jong | PyGMO.problem.dejong | |
De Jong | PyGMO.problem.py_example | Implemented directly in Python |
Griewank | PyGMO.problem.griewank | |
Himmelblau | PyGMO.problem.himmelblau | Bi-dimensional problem |
Lennard-Jones | PyGMO.problem.lennard_jones | |
Michalewicz | PyGMO.problem.michalewicz | |
Rosenbrock | PyGMO.problem.rosenbrock | |
Rastrigin | PyGMO.problem.rastrigin | |
Schwefel | PyGMO.problem.schwefel | |
MGA-1DSM (tof encoding) | PyGMO.problem.mga_1dsm_tof | Requires the GTOP database option active |
MGA-1DSM (alpha encoding) | PyGMO.problem.mga_1dsm_alpha | Requires the GTOP database option active |
Cassini 1 | PyGMO.problem.cassini_1 | Requires the GTOP database option active |
Cassini 2 | PyGMO.problem.cassini_2 | Requires the GTOP database option active |
Rosetta | PyGMO.problem.rosetta | Requires the GTOP database option active |
Tandem | PyGMO.problem.tandem | Requires the GTOP database option active |
Laplace | PyGMO.problem.tandem | Requires the GTOP database option active |
Messenger (Full Problem) | PyGMO.problem.messenger_full | Requires the GTOP database option active |
GTOC1 | PyGMO.problem.gtoc_1 | Requires the GTOP database option active |
Sagas | PyGMO.problem.sagas | Requires the GTOP database option active |
Common Name | Name in PyGMO | Comments |
---|---|---|
Kursawe’s study | PyGMO.problem.kur | |
Fonseca and Fleming’s study | PyGMO.problem.fon | |
Poloni’s study | PyGMO.problem.pol | |
Shaffer’s study | PyGMO.problem.sch | |
ZDT | PyGMO.problem.zdt | |
DTLZ | PyGMO.problem.dtlz | |
CEC2009 (UF1-UF10) | PyGMO.problem.cec2009 | UF problems from CEC2009 Competition. |
MGA-1DSM (tof encoding) | PyGMO.problem.mga_1dsm_tof | Requires the GTOP database option active |
MGA-1DSM (alpha encoding) | PyGMO.problem.mga_1dsm_alpha | Requires the GTOP database option active |
Cassini 1 | PyGMO.problem.cassini_1 | Requires the GTOP database option active |
Common Name | Name in PyGMO | Comments |
---|---|---|
CEC2006 | PyGMO.problem.cec2006 | 24 problems part of CEC2006 Competition |
Pressure vessel design | PyGMO.problem.pressure_vessel | |
Welded beam design | PyGMO.problem.welded_beam | |
Tension compression string design | PyGMO.problem.tens_comp_string | |
Luksan Vlcek 1 | PyGMO.problem.luksan_vlcek_1 | |
Luksan Vlcek 2 | PyGMO.problem.luksan_vlcek_2 | |
Luksan Vlcek 3 | PyGMO.problem.luksan_vlcek_3 | |
Planet to Planet LT Transfer | PyGMO.problem.py_pl2pl | Requires PyKEP. Implemented in Python |
SNOPT Toy-Problem | PyGMO.problem.snopt_toyprob | |
GTOC2 (Full Problem) | PyGMO.problem.gtoc_2 | Requires the GTOP database option active |
Common Name | Name in PyGMO | Comments |
---|---|---|
CEC2009 (CF1-CF10) | PyGMO.problem.cec2009 | CF problems from CEC2009 Competition. |
Common Name | Name in PyGMO | Comments |
---|---|---|
String Match | PyGMO.problem.string_match |
Common Name | Name in PyGMO | Comments |
---|---|---|
Golomb Ruler | PyGMO.problem.golomb_ruler | |
Traveling Salesman | PyGMO.problem.tsp | |
Knapsack | PyGMO.problem.knapsack |
Common Name | Name in PyGMO | Comments |
---|---|---|
Inventory Problem | PyGMO.problem.inventory | |
MIT SPHERES | PyGMO.problem.mit_spheres | |
Noisy De Jong | PyGMO.problem.py_example_stochastic |
Base problem constructor. It must be called from within the derived class constructor __init__()
USAGE: super(derived_class_name,self).__init__(dim, i_dim, n_obj, c_dim, c_ineq_dim, c_tol)
Best known decision vector(s).
Best known fitness vector(s).
Best known constraints vector(s).
Global dimension.
Fitness dimension.
Integer dimension.
Global constraints dimension.
Inequality constraints dimension.
Tolerance used in constraints analysis.
This is a virtual function tham must be re-implemented in the derived class and must return a tuple packing as many numbers as the problem objectives (n_obj)
This is a virtual function that can be re-implemented in the derived class (if c_dim>0) and must return a tuple packing as many numbers as the declared dimension of the problem constraints (c_dim). Inequality constarints need to be packed at last.
This is a virtual function that can be re-implemented in the derived class and must return a boolean value. Return true if f1 Pareto dominate f2, false otherwise. The default implementation will assume minimisation for each one of the f components i.e., each pair of corresponding elements in f1 and f2 is compared: if all elements in f1 are less or equal to the corresponding element in f2 (and at least one is less), true will be returned. Otherwise, false will be returned.
This is a virtual function tham can be re-implemented in the derived class (if c_dim>0) and must return a boolean value. Return true if c1 is a strictly better constraint vector than c2, false otherwise. Default implementation will return true under the following conditions, tested in order: c1 satisfies more constraints than c2, c1 and c2 satisfy the same number of constraints and the L2 norm of the constraint mismatches for c1 is smaller than for c2. Otherwise, false will be returned.
This is a virtual function that can be re-implemented in the derived class (if c_dim>0) and must return a boolean value. By default, the function will perform sanity checks on the input arguments and will then call _compare_constraints_impl() if the constraint dimensions is not null, _compare_fitness_impl() otherwise.
Resets the internal caching system of PyGMO that stores previos calls to the objective function/ constraint function. This method should be called whenever a problem object is changed and the change affects the objective function.
Set all bounds to the input values.
Determine feasibility of decision vector.
Determine feasibility of constraint vector.
Implements a meta-problem class that wraps some other constrained problems, resulting in death penalty constraints handling. Three implementations of the death penalty are available. The first one is the most common simple death penalty. The second one is the death penalty defined by Angel Kuri Morales et al. (Kuri Morales, A. and Quezada, C.C. A Universal eclectic genetic algorithm for constrained optimization, Proceedings 6th European Congress on Intelligent Techniques & Soft Computing, EUFIT‘98, 518-522, 1998.) Simple death penalty penalizes the fitness function with a high value, Kuri method penalizes the fitness function according to the rate of satisfied constraints. The third one is a weighted static penalization. It penalizes the objective with the sum of the constraints violation, each one penalized with a given factor.
USAGE: problem.death_penalty(problem=PyGMO.cec2006(4), method=death_penalty.method.SIMPLE)
Implements a meta-problem class that wraps some other constrained problems, resulting in multi-objective problem.
Three implementations of the constrained to multi-objective are available. For a problem with m constraints, m+1 objective functions, the first objective function is the original objective function. The first implementation is the constrained to multi-objective defined by Coello Coello. The objectives defined from constraints includes number of violated constraints and objective functions. The second implementation is the COMOGA multi-objective problem: a biobjective problem with the second objective the sum of the violations of the constraints. The third implementation is the same as the second one but splitting the sum of violations between equality and inequality constraints, resulting in a total of three objectives problem.
USAGE: problem.con2mo(problem=PyGMO.cec2006(4), method=con2mo.method.OBJ_CSTRS)
problem: original PyGMO constrained problem
set with OBJ_CSTRSVIO and COMOGA with splitting of inequality and equality constraints set with OBJ_EQVIO_INEQVIO
Implements a meta-problem class that wraps constrained problems, resulting in an unconstrained problem. Two methods are available for definig the objective function of the meta-problem: OPTIMALITY and FEASIBILITY. The OPTIMALITY uses as objective function the original objective function, it basically removes the constraints from the original problem. The FEASIBILITY uses as objective function the sum of the violation of the constraints, the meta-problem hence optimize just the level of infeasibility.
Implements a meta-problem class that wraps some other constrained problems, resulting in multi-objective problem.
USAGE: problem.con2uncon(problem=PyGMO.cec2006(4), method=con2uncon.method.OPTIMALITY)
Shifts a problem.
USAGE: problem.shifted(problem=PyGMO.ackley(1), shift = a random vector)
The shift vector defining the new problem
Returns the de-shifted decision vector
Rotates a problem. (also reflections are possible) The new objective function will be f(Rx_{normal}), where R is an orthogonal matrix and x_{normal} is the decision vector normailized to [-1,1]
NOTE: To ensure all of the original space is included in the new box-constrained search space, bounds of the normalized variables are expanded to [-sqrt(2),sqrt(2)]. It is still guaranteed theat the original objective function will not be called outside of the original bounds by projecting points outside the original space onto the boundary
USAGE: problem.rotated(problem=PyGMO.ackley(1), rotation = a random orthogonal matrix)
The rotation matrix defining the new problem
Returns the de-rotated decision vector
Inject noise to a problem. The new objective function will become stochastic, influence by a normally distributed noise.
USAGE: problem.noisy(problem=PyGMO.ackley(1), trials = 1, param_first=0.0, param_second=1.0, noise_type = problem.noisy.noise_distribution.NORMAL, seed=0)
Normalizes a problem (e.g. maps all variables to [-1,1])
NOTE: this meta-problem constructs a new problem having normalized bounds/variables
USAGE: problem.normalized(problem=PyGMO.ackley(1))
Returns the de-normalized decision vector
Implements a meta-problem class resulting in a decomposed version of the multi-objective input problem, i.e. a single-objective problem having as fitness function some kind of combination of the original fitness functions.
NOTE: this meta-problem constructs a new single-objective problem
USAGE: problem.decompose(problem=PyGMO.zdt(1, 2), method = problem.decompose.WEIGHTED, weights=a random vector (summing to one), z= a zero vector)
The weights vector
Weighted decomposition method
Tchebycheff decomposition method
Boundary Intersection decomposition method
Constructs a Ackley problem (Box-Constrained Continuous Single-Objective)
USAGE: problem.ackley(dim=10)
Constructs a Bukin’s f6 problem (Box-Constrained Continuous Single-Objective)
USAGE: problem.bukin()
Constructs one of the 24 CEC2006 Competition Problems (Constrained Continuous Single-Objective)
USAGE: problem.cec2006(prob_id=1)
Constructs a pressure vessel design problem (Constrained Continuous Single-Objective)
USAGE: problem.pressure_vessel()
Constructs a welded beam design problem (Constrained Continuous Single-Objective)
USAGE: problem.welded_beam()
Constructs a tension compression string design problem (Constrained Continuous Single-Objective)
USAGE: problem.tens_comp_string()
Constructs one of the 20 CEC2009 Competition Problems (Constrained / Unconstrained Multi-Objective)
USAGE: problem.cec2009(prob_id=1, dim=30, is_constrained=False)
Constructs one of the 28 CEC2013 Competition Problems (Box-Constrained Continuous Single-Objective)
NOTE: this problem requires two files to be put in the path indicated: “M_Dxx.txt” and “shift_data.txt”. These files can be downloaded from the CEC2013 competition site: http://web.mysites.ntu.edu.sg/epnsugan/PublicSite/Shared%20Documents/CEC2013/cec13-c-code.zip
USAGE: problem.cec2013(dim = 10, prob_id=1, path=”input_data/”)
Constructs a Rosenbrock problem (Box-Constrained Continuous Single-Objective)
USAGE: problem.rosenbrock(dim=10)
Constructs a string-match problem (Box-Constrained Integer Single-Objective)
NOTE: This is the problem of matching a string. Transcribed as an optimization problem
USAGE: problem.string_match(string = “mah”)
Returns a string decoding the chromosome
Constructs a Rastrigin problem (Box-Constrained Continuous Single-Objective)
USAGE: problem.rastrigin(dim=10)
Constructs a Schwefel problem (Box-Constrained Continuous Single-Objective)
USAGE: problem.schwefel(dim=10)
Constructs a De Jong problem (Box-Constrained Continuous Single-Objective)
USAGE: problem.dejong(dim=10)
Constructs a De Jong problem (Box-Constrained Continuous Single-Objective)
USAGE: problem.dejong(dim=10)
Constructs a Lennard-Jones problem (Box-Constrained Continuous Single-Objective)
USAGE: problem.lennard_jones(n_atoms=4)
Constructs a Branin problem (Box-Constrained Continuous Single-Objective)
USAGE: problem.branin()
Constructs a Himmelblau problem (Box-Constrained Continuous Single-Objective)
USAGE: problem.himmelblau()
Constructs a Michalewicz problem (Box-Constrained Continuous Single-Objective)
USAGE: problem.michalewicz(dim=5)
NOTE: Minimum is -4.687 for dim=5 and -9.66 for dim = 10
Constructs a Kursawe’s study problem (Box-Constrained Continuous Multi-Objective)
NOTE: K Deb, A Pratap, S Agarwal: A fast and elitist multiobjective genetic algorithm: NSGA-II, IEEE Transactions on, 2002
USAGE: problem.kur(dim = 10)
Constructs a Fonseca and Fleming’s study problem (Box-Constrained Continuous Multi-Objective)
NOTE: K Deb, A Pratap, S Agarwal: A fast and elitist multiobjective genetic algorithm: NSGA-II, IEEE Transactions on, 2002
USAGE: problem.fon()
Constructs a Poloni’s study study problem (Box-Constrained Continuous Multi-Objective)
NOTE: K Deb, A Pratap, S Agarwal: A fast and elitist multiobjective genetic algorithm: NSGA-II, IEEE Transactions on, 2002
USAGE: problem.pol()
Constructs a Schaffer’s study problem (Box-Constrained Continuous Multi-Objective)
NOTE: K Deb, A Pratap, S Agarwal: A fast and elitist multiobjective genetic algorithm: NSGA-II, IEEE Transactions on, 2002
USAGE: problem.sch()
Constructs a multi-objective box-constrained problem from the ZDT testsuite
NOTE: K Deb, A Pratap, S Agarwal: A fast and elitist multiobjective genetic algorithm: NSGA-II, IEEE Transactions on, 2002
USAGE: problem.zdt(prob_id = 1, param_1 = 30)
The p distance is a convergence metric measuring the distance of a population or individual from the pareto front. It is typically 0.0 if the individuals lie on the Pareto-front.
USAGE: x = prob.p_distance(pop) USAGE: x = prob.p_distance(x)
- pop: population to evaluate
- x: chromosome to evaluate
p_distance( (zdt)arg1, (population)arg2) -> float
Constructs a multi-objective box-constrained problem from the DTLZ testsuite
NOTE: K Deb, L Thiele, M Laumanns, E Zitzler, Scalable test problems for evolutionary multiobjective optimization
USAGE: problem.dtlz(prob_id = 1, k = 20, fdim = 4)
- prob_id: Problem number, one of [1,2,...7]
- k: paramter defining integer dimension of the problem: k + fdim - 1
- fdim: number of objectives
- alpha: controls density of solutions (just used for prob_id = 4)
The p distance is a convergence metric measuring the distance of a population or individual from the pareto front. It is typically 0.0 if the individuals lie on the Pareto-front.
USAGE: x = prob.p_distance(pop) USAGE: x = prob.p_distance(x)
- pop: population to evaluate
- x: chromosome to evaluate
p_distance( (dtlz)arg1, (population)arg2) -> float
Generic plot-method for multi-objective optimization problems with more then 2 objectives
USAGE: prob.plot(pop, comp[0,2,3]) * pop: population of solutions to the problem * a: angle of view on which the 3d-plot is created * comp: indexes the fitness dimension for x,y and z axis in that order
Constructs a Travelling Salesman problem (Constrained Integer Single-Objective)
USAGE: problem.tsp(matrix = [0,1,2],[1,0,5],[2,5,0])
Constructs a Golomb Ruler problem (Constrained Integer Single-Objective)
NOTE: see http://en.wikipedia.org/wiki/Golomb_ruler
USAGE: problem.golomb_ruler(order = 5, length=10)
Constructs a 0-1 Knapsack Problem (Constrained Integer Single-Objective)
USAGE: problem.knapsack(values = [1,2,3,4,5], weights = [10, 40, 30, 50, 20], max_weight = 100)
Constructs the first Luksan Vlcek problem (Constrained Continuous Single-Objective)
NOTE: L. Luksan and J. Vlcek, “Sparse and Parially Separable Test Problems for Unconstrained and Equality Constrained Optimization”
USAGE: problem.luksan_vlcek_1(dim=3)
Constructs the second Luksan Vlcek problem (Constrained Continuous Single-Objective)
NOTE: L. Luksan and J. Vlcek, “Sparse and Parially Separable Test Problems for Unconstrained and Equality Constrained Optimization”
USAGE: problem.luksan_vlcek_2(dim=16)
Constructs the third Luksan Vlcek problem (Constrained Continuous Single-Objective)
NOTE: L. Luksan and J. Vlcek, “Sparse and Parially Separable Test Problems for Unconstrained and Equality Constrained Optimization”
USAGE: problem.luksan_vlcek_3(dim=8)
Constructs SNOPT toy-problem (Box-Constrained Continuous Multi-Objective)
USAGE: problem.snopt_toyprob()
Constructs an Inventory Problem (Stochastic Objective Function)
NOTE: see www2.isye.gatech.edu/people/faculty/Alex_Shapiro/SPbook.pdf
USAGE: problem.inventory(weeks = 4, sample_size = 10, seed = 0):
to plan the inventory for.
sample_size: dimension of the sample used to approximate the expected value
pseudorandom sequences used to generate the sample
Construct a Neurocontroller Evolution problem that seeks to drive three point masses to form a triangle This problem was used to design a contorller for the MIT SPHERES test bed on boear the ISS
USAGE: problem.mit_spheres(sample_size = 10, n_hidden = 10, ode_prec = 1E-3, seed = 0, symmetric = False, simulation_time = 50.0):
Returns a tuple with the N post evaluation results of chromosome x w.r.t. conditions generated by seed. The returned tuple has the structure [ic, fit] and is sorted by fit. Where ic are the initial conditions and fit the Evaluated fitness.
Returns the SPHERES coordinates as evaluated in one simulation with initial conditions ic and in N points
Requires VPython installed. It opens a graphical display and animate the motion of the three SPHERES as desribed by the world_state tuple (output from the simulate method)
Constructs an mga_1dsm problem (tof-encoding)
USAGE: problem.mga_1dsm(seq = [planet_ss(‘earth’),planet_ss(‘venus’),planet_ss(‘earth’)], t0 = [epoch(0),epoch(1000)], tof = [ [200, 700], [200, 700] ], vinf = [0.5, 2.5], multi_objective = False, add_vinf_dep = False, add_vinf_arr = True)
Plots the trajectory represented by the decision vector x
Resets the tof-bounds by the provided list of epochs. Needs a list consisting of lower/upper bound tuples.
Resets the launch windows to the lower and upper bounds given by tuple t0. Bounds need to be epochs.
Sets the upper bound for vinf to vinf_u
Returns a string with informations about tour encoded by x
Constructs an mga_1dsm problem (alpha-encoding)
USAGE: problem.mga_1dsm(seq = [planet_ss(‘earth’),planet_ss(‘venus’),planet_ss(‘earth’)], t0 = [epoch(0),epoch(1000)], tof = [ [200, 700], [200, 700] ], vinf = [0.5, 2.5], multi_objective = False, add_vinf_dep = False, add_vinf_arr = True)
Plots the trajectory represented by the decision vector x
Resets the tof-bounds by the provided tuple of epochs.
Resets the launch windows to the lower and upper bounds given by tuple t0. Bounds need to be epochs.
Sets the upper bound for vinf to vinf_u
Returns a string with informations about tour encoded by x
Constructs a Cassini 1 Problem (Box-Constrained Continuous Single-Objective)
USAGE: problem.cassini_1(objectives = 1)
Constructs a Cassini 2 Problem (Box-Constrained Continuous Single-Objective)
It models the same interplanetary trajectory as the cassini_1 problem, but in a more accurate fashion, allowing deep space manouvres
Best known global minimum is at 8.383 [km/s]
USAGE: problem.cassini_2()
Constructs a Mesenger Full Problem (Box-Constrained Continuous Single-Objective)
NOTE: This problem (MGA-1DSM) belongs to the GTOP database [http://www.esa.int/gsp/ACT/inf/op/globopt.htm]
Best known global minimum is at 2.113
USAGE: problem.messenger_full()
Constructs a Rosetta Problem (Box-Constrained Continuous Single-Objective)
NOTE: This problem (MGA-1DSM) belongs to the GTOP database [http://www.esa.int/gsp/ACT/inf/op/globopt.htm]
Best known global minimum is at 1.343 [km/s]
USAGE: problem.rosetta()
Constructs a EJSM-Laplace Problem (Box-Constrained Continuous Single-Objective)
USAGE: problem.laplace(seq = [3,2,3,3,5])
1 - Mercury, 2 - Venus, 3 - Earth, 4 - Mars, 5 - Jupiter, 6 - Saturn. It must start from 3 (Earth) and end with 5 (Jupiter)
Constructs a TandEM Problem (Box-Constrained Continuous Single-Objective)
NOTE: This problem (MGA-1DSM) belongs to the GTOP database [http://www.esa.int/gsp/ACT/inf/op/globopt.htm]. The objective function is -log(m_final).
USAGE: problem.tandem(prob_id = 7, max_tof = -1)
Constructs a GTOC 1 Problem (Box-Constrained Continuous Single-Objective)
NOTE: This problem (MGA) belongs to the GTOP database [http://www.esa.int/gsp/ACT/inf/op/globopt.htm]
Best known global minima is at -1,581,950
USAGE: problem.gtoc_1()
__init__( (object)arg1 [, (int)arg2 [, (int)arg3 [, (int)arg4 [, (int)arg5 [, (int)arg6 [, (_gtoc_2_objective)arg7]]]]]]) -> None
Constructs a low-thrust transfer between a departure planet and a target planet (Constrained Continuous Single-Objective)
NOTE: An impulsive transcription is used to transform into an NLP the Optimal Control Problem
USAGE: problem.py_pl2pl(self,mass=1000,Tmax=0.05,Isp=2500,Vinf_0=3,Vinf_f=0,nseg=10,departure = PyKEP.planet_ss(‘earth’), target = PyKEP.planet_ss(‘mars’))
mass: spacecraft mass at departure [kg]
Tmax: maximum allowed thrust [N]
Isp: spacecarft engine specific impulse [Isp]
Vinf_0: allowed maximum starting velocity [km/s]
(if negative it is interpreted as a minimum arrival velocity)
nseg: number of segments used for the impulsive transcription
departure: departure planet (a PyKEP planet)
target: arrival planet (a PyKEP planet)
Constructs a SAGAS Problem (Box-Constrained Continuous Single-Objective)
NOTE: This problem (MGA-1DSM) belongs to the GTOP database [http://www.esa.int/gsp/ACT/inf/op/globopt.htm]
USAGE: problem.sagas()