Skip to content

Physarum

Math Chaos

Physarum is a particle-based simulation that mimics the foraging behavior and transport network formation of the Physarum polycephalum slime mold. It demonstrates how complex, efficient networks can emerge from a collection of simple agents.

The simulation relies on agents (particles) that follow a few basic rules:

  1. Sensing: Each agent senses the “chemical” (trail) density in its immediate vicinity.
  2. Rotation: Agents turn toward areas with higher trail concentration.
  3. Movement: Agents move forward and deposit their own trail onto the environment.
  4. Diffusion & Decay: The global trail map slowly diffuses and decays over time.

These simple interactions result in the formation of intricate, branching networks that resemble biological transport systems.

Agent-Based Modeling

Thousands of independent agents interacting with a shared environment.

Generative Networks

Creates complex, organic-looking branching structures from minimal rules.

Go Implementation

High-performance simulation logic implemented in Go.

Visual Output

Generates high-contrast visualizations of the emergent transport networks.

  • Go (Golang) installed on your system.

Execute the following command to start the simulation:

  1. Navigate to the directory

    Terminal window
    cd Math_Chaos/Physarum
  2. Run the main script

    Terminal window
    go run cmd/physarum/main.go
  • pkg/: Contains the core simulation logic, including agent behavior and trail map processing.
  • cmd/: Entry point for the application.
  • images/: Sample outputs showing different network configurations and color palettes.