Python Evolutionary Algorithm Visualistaion toolkit on DEAP
PEAviz bridges DEAP with graph analysis tools like graph-tool. The aim of PEAviz is to enable tracking of evolutionary dynamics and present a network of individuals that encodes all that you want.
Evolutionary dynamics are not very well understood yet, and the network generated by PEAviz can provide not just experimental data but analysis might uncover previously unknown facts and patterns. The analysis might also provide proof for known hypothesis on GA behaviours!
Alas, as of mid 2017, there is no universally accepted way of tranforming dynamics into a network, and the default transformation (which is called Encoding Strategy) implemented in PEAviz, is not necessarily the best one.
For each individual added into the population,
- A node is created.
- two or more nodes can encode the same individual (genetic material) because the same individual can be added into the population at different iterations, possibly with different parents.
- Thus, nodes are NOT UNIQUE.
- Edges are added from parents to this node.
- The network might have parallel edges, as the selection process of a GA might allow the same individual to be picked twice, as a parent!
To find out more about the approach refer
Davendra, Donald, et al. "Complex network analysis of differential evolution algorithm applied to flowshop with no-wait problem." Differential Evolution (SDE), 2014 IEEE Symposium on. IEEE, 2014.
on IEEE Xplore
The paper above uses this strategy to study a Self Organising Migrating Algorithm, but the strategy can be used to study other EAs too.
PEAviz is composed of 3 elements, Adapter, Tracker and Encoding strategy.
Adapter
: Interface that implements all actions required to create the Graph
representation and maintain it. This could be,
a graph-tool Graph
or,
a neo4j DB connection or,
a Gephi GraphStream Object.
Encoding Strategy : This details what an individual is, its attributes and when or how edges are created, whether they are directed or undirected, etc.
Tracker : Your GA creates an instance of this and connects it to the desired Adapter(s). Tracker uses the Encoding Strategy to invoke Adapter methods and create the desired evolutionary network.
Trackers and Encoding Strategy are highly coupled, ie, a new Tracker is required for a new Encoding Strategy.
- Adapters
graph-tool
💯- Neo4j 🔜
- GraphStream 🔜
- Trackers
Base
tracker for the default strategy. 💯
- Encoding Strategies
- Default Strategy 💯
💯 denotes completed.
🔜 denotes future goals.
- Implement your GA in DEAP
- Use
peaviz
elements to track the dynamics.- Decide Encoding Strategy, or use the default.
- Implement a Tracker Interface for your Encoding Strategy.
- Use an Adapter, or implement your own.
- Execute GA, upon completion PEAviz provides a network.
- Export the network to desired analysis tool (we use
graph-tool
). - Analyse.
DEAP is a very flexible framework to run evoultionary algorithms. We can fine tune all aspects of the evolution
and individuals
.
Why graph-tool
GT is an excellent python package which allows scripted analysis Graph filtering and GraphViews that are ideal for manipulating and visualising graph objects.
PEAviz has not yet been pacakged, see #5
- Install the python requirements:
pip install -r requirements.txt
- Optionally install
graph-tool
. Instructions
Testing onemax.py
Force Atlas Layout: Animated gif
(2.5MB)
A different layout of the same graph:
This work is part of our Undergraduate Degree Course Work.