Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Evolving structures in complex systems

This repository contains the code to reproduce the Figures and numerical results from the paper: Evolving structures in complex systems by Hugo Cisneros, Josef Sivic and Tomas Mikolov.

Project Slides

Build the C library

The provided C library implements a general cellular automaton simulator and all the steps for computing the metrics we discuss in the paper.

The library can be built with

make all

which will create a binary in bin/automaton. So far, this has only been tested on OSX.

Generate automata

Rule file format

Automata rules are encoded in mapping files with the following format:

Possible transitions are enumerated for a 3x3 neighborhood and N + 1 (0 to N) states in the way described below, starting from the top-left cell and incrementing in a row-first manner a base-N counter with 8 cells.


Mapping files just enumerate the resulting state of the middle cell for the corresponding neighborhood state. There are possible 3x3 neighborhoods rules.

Obtaining the rule files from the paper

Mapping files with the 3-states rules reported in the paper can be obtained at the following link. The unzipped maps directory contains the subdirectories train and test that correspond to the training and testing sets used in the paper.

Simulating automata

Once the maps directory is placed at the root of this directory, running


will simulate all automata from the maps and compute the various metrics we discuss in the paper (this might take a while to complete). The script calls the executable bin/automaton with some options for each .map file.

Compute metrics

After simulating the automata, the metrics are automatically computed. We compute:

  • The compressed length of the automaton state at step 1000.
  • The lookup table based metric.
  • The neural network based metric.

All metrics are then stored in files for further processing

Wrapping all this in a script

All the steps described above are also wrapped in a single script that you can run with the command ./scripts/

Reproduce results from the paper

The results in the paper and values computed to produce those results are in data/, they were computed with a script that you can run with:

python3 scripts/

Another script extracts results from files generated by the script. You can run it with

python3 scripts/

Visualization tools

Automata evolution can be visualized by generating a GIF image with the script in tools/viz/. It assigns a set of colors based on the number of states

For more information about the command, execute

tools/viz/ -h

Playing with initialization patterns

The library supports specifying a initial pattern for a simulation. Several example patterns are in example_patterns/.

Patterns can be defined with a specific file format, of which an example is given below.


The quantity after N is the number of states, the one after R is the rule ID. BG is an optional value to set all cells not specified in the pattern to a given state. The pattern itself is delimited by # characters, and is just a rectangle with, for each cell of the pattern, the corresponding state.

When simulating a pattern, one can still choose the size of the automaton, the number of steps, etc. The patterns will be centered in the middle of the automaton for easier visualization.

As an example, the following command that uses the spaceship pattern above, with the four states rule 1685000103177278144

tools/viz/ -n 4 \
                             -t 300 \
                             -g 1 \
                             -d 5 \
                             -j example_patterns/spaceships_4.pat \
                             -s 32 \

produces the following GIF at ./rule_gif/temp.gif:


Another example:

tools/viz/ -n 3 -g 10 -t 2000 -d 10 -s 128 \
                               -j example_patterns/exploding_3.pat \

It produces



Dataset and code to reproduce the results of the paper "Evolving Structures in Complex Systems"








No releases published


No packages published