---
id: "physarum-transport-networks"
title: "Physarum agent transport networks"
domain: "simulation"
stage: "simulation"
realtime: "realtime"
platforms: [webgl2, webgpu, desktop-gpu, cpu]
year_introduced: 2010
inputs: [particles, texture]
outputs: [texture, graph]
style: "stylized"
dynamic: "dynamic"
cost: "cheap"
authority: "Jones, 2010"
url: "https://texelatlas.vercel.app/t/physarum-transport-networks/"
sources_verified_at: "2026-11-29"
---
# Physarum agent transport networks (Jones, 2010)

> Multi-agent slime-mold model: agents deposit and follow a trail map, producing self-organising vein-like networks that join points of interest.

## Reach for it when

- want organic vein or root-like networks
- generate city-like path networks connecting points
- need slime-mould style generative art
- branching network textures from simple agents

## How it works

Thousands of agents carry a position and heading. Each step an agent samples the trail map at three sensors (left, ahead, right) at a sensor distance, turns toward the strongest, moves forward a fixed step, and deposits chemoattractant at its position. The trail map is then diffused (blur) and decayed. This feedback concentrates flow into thin lines that merge and prune into transport-network graphs, and food sources or heightmaps bias agents toward targets. On the GPU the agents run in a compute pass and the trail map is a ping-pong texture. Parameters (sensor angle and distance, turn speed, decay, diffusion) change the look from filaments to webs to blobs.

## When to use it

Choose it for organic network, vein, root and city-like path structures, or generative art with an agent-driven look. Prefer [Gray-Scott reaction-diffusion](https://texelatlas.vercel.app/t/gray-scott-reaction-diffusion.md) for spot/stripe/maze patterns, [Boids flocking](https://texelatlas.vercel.app/t/boids.md) for flocks that do not need a persistent trail, and graph algorithms (MST, Steiner) when you need an exact optimal network.

## Cost

cheap — Cheap-to-medium: agent count x 3 samples, plus blur of the trail map.
Measured GPU Weight: 23.08× baseline (heavy) — 0.7593 ms median / 0.8363 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 23.07× baseline (heavy) — 0.3668 ms median (2.07× faster on L4).
Ampere A100 scaling: 15.05× baseline (moderate) — 0.4335 ms median (1.75× faster on A100).

## Failure modes

- Result is sensitive to parameters: collapses into dots or saturates into blobs
- Agents clump in corners and borders unless boundary rules are added
- Trail-map resolution limits how thin the lines can get
- Not a real graph: extracting a clean network needs thinning and cleanup

## Dataflow

- Inputs: particles, texture
- Outputs: texture, graph
- Platforms: webgl2, webgpu, desktop-gpu, cpu

## Presets

### Physarum transport networks — emergent slime-mould branching veins & chemotaxis flux (glsl-fragment; rendered 2026-11-30)

```json
{
  "P_VEIN_SHARPNESS": 1.2,
  "P_FLUX_SPEED": 1,
  "P_BRANCH_SCALE": 5.5,
  "P_NODE_GLOW": 1.1
}
```

```glsl
const float P_VEIN_SHARPNESS = 1.2; // P Vein Sharpness [0.4, 2.5, 0.05]
const float P_FLUX_SPEED = 1.0; // P Flux Speed [0.0, 2.5, 0.05]
const float P_BRANCH_SCALE = 5.5; // P Network Scale [2.5, 10.0, 0.2]
const float P_NODE_GLOW = 1.1; // P Nutrient Glow [0.0, 2.2, 0.05]

vec2 hash22(vec2 p) {
  p = vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)));
  return fract(sin(p) * 43758.5453);
}

// Smooth Voronoi edge distance (F2 - F1) yielding organic anastomosing transport ridges
vec3 voronoiVein(vec2 p, float t) {
  vec2 n = floor(p);
  vec2 f = fract(p);
  float d1 = 8.0, d2 = 8.0;
  vec2 bestOff = vec2(0.0);
  for (int j = -1; j <= 1; j++) {
    for (int i = -1; i <= 1; i++) {
      vec2 g = vec2(float(i), float(j));
      vec2 o = hash22(n + g);
      o = 0.5 + 0.38 * sin(t * 0.45 + 6.2831 * o);
      vec2 r = g + o - f;
      float d = dot(r, r);
      if (d < d1) {
        d2 = d1;
        d1 = d;
        bestOff = r;
      } else if (d < d2) {
        d2 = d;
      }
    }
  }
  float edge = sqrt(d2) - sqrt(d1);
  return vec3(edge, sqrt(d1), atan(bestOff.y, bestOff.x));
}

// Organic domain warp to mimic adaptive chemotaxis meandering
vec2 warp(vec2 p, float t) {
  float a = sin(p.x * 2.1 + t * 0.3) * cos(p.y * 2.3 - t * 0.25);
  float b = cos(p.x * 1.9 - t * 0.22) * sin(p.y * 2.5 + t * 0.28);
  return p + 0.14 * vec2(a, b);
}

vec3 aces(vec3 x) {
  x = max(x, 0.0);
  return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
}

void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
  float t = iTime * max(P_FLUX_SPEED, 0.0);
  float scale = clamp(P_BRANCH_SCALE, 2.0, 12.0);
  float sharp = clamp(P_VEIN_SHARPNESS, 0.3, 3.0);

  // Petri dish dark agar backdrop with subtle radial depth
  vec3 bg = mix(vec3(0.015, 0.024, 0.032), vec3(0.035, 0.055, 0.068), smoothstep(0.65, 0.0, length(uv)));

  // Three hierarchical Physarum transport vein scales (primary trunks, secondary vessels, fine capillaries)
  vec2 wp = warp(uv, t * 0.6);
  vec3 v1 = voronoiVein(wp * scale * 0.62, t * 0.4);
  vec3 v2 = voronoiVein(wp * scale * 1.25 + vec2(3.7, 1.9), t * 0.65);
  vec3 v3 = voronoiVein(wp * scale * 2.55 - vec2(1.4, 4.2), t * 0.85);

  // Peristaltic shuttle-streaming pulse traveling along veins
  float pulse1 = 0.65 + 0.35 * sin(v1.z * 3.0 - t * 3.4 + length(uv) * 8.0);
  float pulse2 = 0.65 + 0.35 * sin(v2.z * 4.0 + t * 4.2 - length(uv) * 12.0);

  // Nutrient food nodes anchoring high-flux primary highways
  float nodeField = 0.0;
  float nodeCore = 0.0;
  for (int i = 0; i < 6; i++) {
    float fi = float(i);
    float ang = fi * 1.0472 + 0.25 * sin(t * 0.2 + fi);
    float rad = 0.26 + 0.11 * sin(fi * 2.1 + 0.4);
    vec2 np = vec2(cos(ang), sin(ang)) * rad;
    float d = length(uv - np);
    nodeField += exp(-d * 4.8);
    nodeCore += exp(-d * 24.0);
  }
  float colonyMask = smoothstep(0.62, 0.14, length(uv) - 0.08 * nodeField);

  // Adaptive vein thickness reinforced near nutrient sources
  float trunk = exp(-v1.x * (12.0 * sharp / (0.75 + 0.65 * nodeField))) * pulse1;
  float branch = exp(-v2.x * (17.0 * sharp)) * pulse2 * (0.45 + 0.55 * trunk + 0.35 * nodeField);
  float capil = exp(-v3.x * (24.0 * sharp)) * (0.28 + 0.6 * branch);

  float density = (trunk * 1.15 + branch * 0.72 + capil * 0.38) * colonyMask;

  // Chemotaxis agent micro-sparks streaming through the veins
  float agentWave = 0.5 + 0.5 * sin(v1.y * 42.0 - t * 6.0) * cos(v2.y * 36.0 + t * 5.0);
  float agents = pow(agentWave, 4.0) * smoothstep(0.2, 0.85, trunk + branch * 0.6);

  // Bioluminescent Physarum gold/amber core with cyan chemotaxis trail halo
  vec3 trailHalo = vec3(0.08, 0.42, 0.52) * pow(clamp(density, 0.0, 1.0), 0.7) * 0.65;
  vec3 veinGold = vec3(1.15, 0.78, 0.18) * pow(clamp(density, 0.0, 1.4), 1.35);
  vec3 veinCore = vec3(1.45, 1.28, 0.72) * smoothstep(0.62, 1.35, density) * 0.85;
  vec3 sparkCol = vec3(0.45, 1.0, 0.85) * agents * 0.85;
  vec3 foodCol = vec3(0.28, 0.92, 1.15) * nodeCore * max(P_NODE_GLOW, 0.0) * 1.1;

  vec3 col = bg + trailHalo + veinGold + veinCore + sparkCol + foodCol;

  // Faint petri dish rim
  float rim = smoothstep(0.012, 0.0, abs(length(uv) - 0.46));
  col += vec3(0.14, 0.24, 0.32) * rim * 0.4;

  fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}
```

Attribution: Original interactive WebGL2 fragment shader written for Texel Atlas (MIT).

## Combination ideas

- [Cities wired by slime mould](https://texelatlas.vercel.app/ideas/slime-mould-road-networks/)

## Sources

1. [primary] Jeff Jones (2010) Characteristics of Pattern Formation and Evolution in Approximations of <i>Physarum</i> Transport Networks. Artificial Life. https://doi.org/10.1162/artl.2010.16.2.16202 (verified via crossref on 2026-11-29)
2. [tutorial] Sage Jenson physarum. cargocollective.com. https://cargocollective.com/sagejenson/physarum (verified via http on 2026-11-29)

## Cite this entry

Texel. "Physarum agent transport networks." https://texelatlas.vercel.app/t/physarum-transport-networks/ (accessed 2026-12-01).
