Deap - Distributed Evolutionary Algorithms in Python

  •        0

DEAPDEAP is intended to be an easy to use distributed evolutionary algorithm library in the Python language. Its two main components are modular and can be used separately. The first module is a Distributed Task Manager (DTM), which is intended to run on cluster of computers. The second part is the Evolutionary Algorithms in Python (EAP) framework. ComponentsDTMDTM is a distributed task manager that is able to spread workload over a buch of computers using a TCP or a MPI connection. DTM include the following features: Easy to use parallelization paradigms Offers a similar interface to the Python's multiprocessing module Basic load balancing algorithm Works over mpi4py Support for TCP communication manager EAPEAP is the evolutionary core of DEAP, it provides data structures, methods and tools to design any kind of evolutionary algorithm. It works in perfect harmony with DTM, allowing easy parallelization of any demanding evolutionary task. EAP includes the following features: Genetic algorithm using any imaginable representation List, Array, Set, Dictionary, Tree, Numpy Array, etc. Genetic programing using prefix trees Loosely typed, Strongly typed Automatically defined functions Evolution strategies (including CMA-ES) Multi-objective optimisation (NSGA-II, SPEA-II) Co-evolution (cooperative and competitive) of multiple populations Parallelization of the evaluations (and more) Hall of Fame of the best individuals that lived in the population Checkpoints that take snapshots of a system regularly Benchmarks module containing most common test functions Genealogy of an evolution (that is compatible with NetworkX) Examples of alternative algorithms : Particle Swarm Optimization, Differential Evolution, Estimation of Distribution Algorithm DocumentationSee the DEAP User's Guide for DEAP 0.8 documentation. In order to get the tip documentation, change directory to the doc subfolder and type in make html, the documentation will be under _build/html. You will need Sphinx to build the documentation. RequirementsThe most basic features of DEAP requires Python2.6. In order to combine the toolbox and the multiprocessing module Python2.7 is needed for its support to pickle partial functions. CMA-ES requires Numpy, and we recommend matplotlib for visualization of results as it is fully compatible with DEAP's API. Version 0.8 is now compatible out of the box with Python 3.2, the installation procedure will automatically translate DEAP to Python 3. ExampleThe following code gives a quick overview how simple it is to implement the Onemax problem optimization with genetic algorithm using DEAP. More examples are provided here. import array, randomfrom deap import creator, base, tools, algorithmscreator.create("FitnessMax", base.Fitness, weights=(1.0,))creator.create("Individual", array.array, typecode='b', fitness=creator.FitnessMax)toolbox = base.Toolbox()toolbox.register("attr_bool", random.randint, 0, 1)toolbox.register("individual", tools.initRepeat, creator.Individual, toolbox.attr_bool, 100)toolbox.register("population", tools.initRepeat, list, toolbox.individual)def evalOneMax(individual): return sum(individual),toolbox.register("evaluate", evalOneMax)toolbox.register("mate", tools.cxTwoPoints)toolbox.register("mutate", tools.mutFlipBit, indpb=0.05)toolbox.register("select", tools.selTournament, tournsize=3)population = toolbox.population(n=300)NGEN=40for gen in range(NGEN): offspring = algorithms.varAnd(population, toolbox, cxpb=0.5, mutpb=0.1) fits =, offspring) for fit, ind in zip(fits, offspring): = fit offspring = [toolbox.clone(ind) for ind in, len(offspring))] population = offspringProjects using DEAPMarc-André Gardner, Christian Gagné and Marc Parizeau, "Bloat Control in Genetic Programming with Histogram-based Accept-Reject Method", in Proc. Genetic and Evolutionary Computation Conference (GECCO 2011), 2011. Vahab Akbarzadeh, Albert Ko, Christian Gagné and Marc Parizeau, "Topography-Aware Sensor Deployment Optimization with CMA-ES", in Proc. of Parallel Problem Solving from Nature (PPSN 2010), Springer, 2010. If you want your project listed here, send us a link and a brief description and we'll be glad to add it.



Related Projects

Zend - PHP application stack

Zend Server is a complete, enterprise-ready Web Application Server for running and managing PHP applications that require a high level of reliability, performance and security. It boosts application performane using byte code optimizer. It provides application stack for PHP application. It also provide support to connect to Java applications.


Compass is a real time searchengine. It is built on top of lucene. It is transactional, distributed, supports Spring MVC, integrates with Hibernate.

JAGA - Java API for Genetic Algorithms

Java API for implementing any kind of Genetic Algorithm and Genetic Programming applications quickly and easily. Contains a wide range of ready-to-use GA and GP algorithms and operators to be plugged-in or extended. Includes Tutorials and Examples.


JGAP is a Genetic Algorithms and Genetic Programming package written in Java. It is designed to require minimum effort to use, but is also designed to be highly modular. JGAP features grid functionality and a lot of examples. Many unit tests included.


Modular Java Framework for Meta-heuristic Optimization


SHARK provides libraries for the design of adaptive systems, including methods for linear and nonlinear optimization (e.g., evolutionary and gradient-based algorithms), kernel-based algorithms and neural networks, and other machine learning techniques. Please vist for the alpha release of Shark 3.0.

Evolving Objects

EO is a template-based, ANSI-C++ evolutionary computation library which helps you to write your own stochastic optimization algorithms. Designing an algorithm with EO consists in choosing what components you want to use for your specific needs.

SISAL Parallel Programming

Sisal is a unique parallel language that supports a clean, fully implicit parallelization model. The optimizing sisal compiler (sisalc) works on top of pthreads to give high performance on commodity SMP architectures.

Red5 - Media Server

Red5 is an Open Source Flash Server written in Java that supports Streaming Video (FLV, F4V, MP4, 3GP), Streaming Audio (MP3, F4A, M4A, AAC), Recording Client Streams (FLV and AVC+AAC in FLV container), Shared Objects, Live Stream Publishing, Remoting Protocols: RTMP, RTMPT, RTMPS, and RTMPE.

Titan - Scalable Graph Database

Titan is a scalable graph database optimized for storing and querying graphs containing hundreds of billions of vertices and edges distributed across a multi-machine cluster. Titan is a transactional database that can support thousands of concurrent users executing complex graph traversals. It is a native Blueprints enabled graph database and as such, it supports the full TinkerPop stack of technologies.