goulib.optim¶
various optimization algorithms : knapsack, traveling salesman, simulated annealing, differential evolution
Functions
|
|
|
|
|
fit items in bins using the "first fit decreasing" method :param items: iterable of items :param bins: iterable of Bin s. |
|
hillclimb until either max_evaluations is reached or we are at a local optima |
|
repeatedly hillclimb until max_evaluations is reached |
|
|
|
Pure Python implementation of the Nelder-Mead algorithm. |
|
generator to return all possible variations where the section between two cities are swapped |
|
generator to create all possible variations where two cities have been swapped |
|
generator of point-to-point distances along a tour |
|
Traveling Salesman Problem @see http://en.wikipedia.org/wiki/Travelling_salesman_problem @param points : iterable containing all points @param dist : function returning the distance between 2 points : def dist(a,b): @param max_iterations :max number of optimization steps @param start_temp, alpha : params for the simulated annealing algorithm. |
Classes
|
a container with a limited capacity :param capacity: int,float,tuple of whatever defines the capacity of the Bin :param f: function f(x) returning the capacity used by item x. |
|
a container with a limited capacity :param capacity: int,float,tuple of whatever defines the capacity of the Bin :param f: function f(x) returning the capacity used by item x. |
|
This is a python implementation of differential evolution taken from http://cci.lbl.gov/cctbx_sources/scitbx/differential_evolution.py |
|
class to wrap an objective function and keep track of the best solution evaluated |
|
a container with a limited capacity :param capacity: int,float,tuple of whatever defines the capacity of the Bin :param f: function f(x) returning the capacity used by item x. |