{
 "id": "physarum-transport-networks",
 "title": "Physarum agent transport networks",
 "aliases": [],
 "domain": "simulation",
 "subdomain": "pattern formation",
 "stage": "simulation",
 "realtime": "realtime",
 "platforms": [
  "webgl2",
  "webgpu",
  "desktop-gpu",
  "cpu"
 ],
 "year_introduced": 2010,
 "inputs": [
  "particles",
  "texture"
 ],
 "outputs": [
  "texture",
  "graph"
 ],
 "style": "stylized",
 "dynamic": "dynamic",
 "summary": "Multi-agent slime-mold model: agents deposit and follow a trail map, producing self-organising vein-like networks that join points of interest.",
 "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": "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` for spot/stripe/maze patterns, `boids` for flocks that do not need a persistent trail, and graph algorithms (MST, Steiner) when you need an exact optimal network.",
 "cost": {
  "class": "cheap",
  "notes": "Cheap-to-medium: agent count x 3 samples, plus blur of the trail map."
 },
 "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"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "doi:10.1162/artl.2010.16.2.16202",
   "type": "paper",
   "title": "Characteristics of Pattern Formation and Evolution in Approximations of <i>Physarum</i> Transport Networks",
   "authors": [
    "Jeff Jones"
   ],
   "year": 2010,
   "venue": "Artificial Life",
   "url": "https://doi.org/10.1162/artl.2010.16.2.16202",
   "ids": {
    "doi": "10.1162/artl.2010.16.2.16202"
   },
   "license": null,
   "extra": {
    "csl_type": "journal-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1162/artl.2010.16.2.16202",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1162/artl.2010.16.2.16202",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1162/artl.2010.16.2.16202",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1162/artl.2010.16.2.16202",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1162/artl.2010.16.2.16202",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "jones2010characteristics"
  },
  {
   "role": "tutorial",
   "key": "url:https://cargocollective.com/sagejenson/physarum",
   "type": "tutorial",
   "title": "physarum",
   "authors": [
    "Sage Jenson"
   ],
   "year": null,
   "venue": "cargocollective.com",
   "url": "https://cargocollective.com/sagejenson/physarum",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20261107183438/https://cargocollective.com/sagejenson/physarum",
     "timestamp": "20261107183438"
    },
    "page_title": "physarum - Sage Jenson",
    "host": "cargocollective.com",
    "title_confirmed_by_page": true,
    "title_unconfirmed": false
   },
   "provenance": {
    "title": {
     "authority": "http",
     "endpoint": "GET https://cargocollective.com/sagejenson/physarum → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://cargocollective.com/sagejenson/physarum → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "http",
     "endpoint": "GET https://cargocollective.com/sagejenson/physarum → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 0.9,
   "__bib": "jensonphysarum"
  }
 ],
 "presets": [
  {
   "id": "physarum-transport-networks-live",
   "title": "Physarum transport networks — emergent slime-mould branching veins & chemotaxis flux",
   "runtime": "glsl-fragment",
   "params": {
    "P_VEIN_SHARPNESS": 1.2,
    "P_FLUX_SPEED": 1,
    "P_BRANCH_SCALE": 5.5,
    "P_NODE_GLOW": 1.1
   },
   "basis": "original",
   "license_note": "Original interactive WebGL2 fragment shader written for Texel Atlas (MIT).",
   "code": "const float P_VEIN_SHARPNESS = 1.2; // P Vein Sharpness [0.4, 2.5, 0.05]\nconst float P_FLUX_SPEED = 1.0; // P Flux Speed [0.0, 2.5, 0.05]\nconst float P_BRANCH_SCALE = 5.5; // P Network Scale [2.5, 10.0, 0.2]\nconst float P_NODE_GLOW = 1.1; // P Nutrient Glow [0.0, 2.2, 0.05]\n\nvec2 hash22(vec2 p) {\n  p = vec2(dot(p, vec2(127.1, 311.7)), dot(p, vec2(269.5, 183.3)));\n  return fract(sin(p) * 43758.5453);\n}\n\n// Smooth Voronoi edge distance (F2 - F1) yielding organic anastomosing transport ridges\nvec3 voronoiVein(vec2 p, float t) {\n  vec2 n = floor(p);\n  vec2 f = fract(p);\n  float d1 = 8.0, d2 = 8.0;\n  vec2 bestOff = vec2(0.0);\n  for (int j = -1; j <= 1; j++) {\n    for (int i = -1; i <= 1; i++) {\n      vec2 g = vec2(float(i), float(j));\n      vec2 o = hash22(n + g);\n      o = 0.5 + 0.38 * sin(t * 0.45 + 6.2831 * o);\n      vec2 r = g + o - f;\n      float d = dot(r, r);\n      if (d < d1) {\n        d2 = d1;\n        d1 = d;\n        bestOff = r;\n      } else if (d < d2) {\n        d2 = d;\n      }\n    }\n  }\n  float edge = sqrt(d2) - sqrt(d1);\n  return vec3(edge, sqrt(d1), atan(bestOff.y, bestOff.x));\n}\n\n// Organic domain warp to mimic adaptive chemotaxis meandering\nvec2 warp(vec2 p, float t) {\n  float a = sin(p.x * 2.1 + t * 0.3) * cos(p.y * 2.3 - t * 0.25);\n  float b = cos(p.x * 1.9 - t * 0.22) * sin(p.y * 2.5 + t * 0.28);\n  return p + 0.14 * vec2(a, b);\n}\n\nvec3 aces(vec3 x) {\n  x = max(x, 0.0);\n  return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);\n}\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;\n  float t = iTime * max(P_FLUX_SPEED, 0.0);\n  float scale = clamp(P_BRANCH_SCALE, 2.0, 12.0);\n  float sharp = clamp(P_VEIN_SHARPNESS, 0.3, 3.0);\n\n  // Petri dish dark agar backdrop with subtle radial depth\n  vec3 bg = mix(vec3(0.015, 0.024, 0.032), vec3(0.035, 0.055, 0.068), smoothstep(0.65, 0.0, length(uv)));\n\n  // Three hierarchical Physarum transport vein scales (primary trunks, secondary vessels, fine capillaries)\n  vec2 wp = warp(uv, t * 0.6);\n  vec3 v1 = voronoiVein(wp * scale * 0.62, t * 0.4);\n  vec3 v2 = voronoiVein(wp * scale * 1.25 + vec2(3.7, 1.9), t * 0.65);\n  vec3 v3 = voronoiVein(wp * scale * 2.55 - vec2(1.4, 4.2), t * 0.85);\n\n  // Peristaltic shuttle-streaming pulse traveling along veins\n  float pulse1 = 0.65 + 0.35 * sin(v1.z * 3.0 - t * 3.4 + length(uv) * 8.0);\n  float pulse2 = 0.65 + 0.35 * sin(v2.z * 4.0 + t * 4.2 - length(uv) * 12.0);\n\n  // Nutrient food nodes anchoring high-flux primary highways\n  float nodeField = 0.0;\n  float nodeCore = 0.0;\n  for (int i = 0; i < 6; i++) {\n    float fi = float(i);\n    float ang = fi * 1.0472 + 0.25 * sin(t * 0.2 + fi);\n    float rad = 0.26 + 0.11 * sin(fi * 2.1 + 0.4);\n    vec2 np = vec2(cos(ang), sin(ang)) * rad;\n    float d = length(uv - np);\n    nodeField += exp(-d * 4.8);\n    nodeCore += exp(-d * 24.0);\n  }\n  float colonyMask = smoothstep(0.62, 0.14, length(uv) - 0.08 * nodeField);\n\n  // Adaptive vein thickness reinforced near nutrient sources\n  float trunk = exp(-v1.x * (12.0 * sharp / (0.75 + 0.65 * nodeField))) * pulse1;\n  float branch = exp(-v2.x * (17.0 * sharp)) * pulse2 * (0.45 + 0.55 * trunk + 0.35 * nodeField);\n  float capil = exp(-v3.x * (24.0 * sharp)) * (0.28 + 0.6 * branch);\n\n  float density = (trunk * 1.15 + branch * 0.72 + capil * 0.38) * colonyMask;\n\n  // Chemotaxis agent micro-sparks streaming through the veins\n  float agentWave = 0.5 + 0.5 * sin(v1.y * 42.0 - t * 6.0) * cos(v2.y * 36.0 + t * 5.0);\n  float agents = pow(agentWave, 4.0) * smoothstep(0.2, 0.85, trunk + branch * 0.6);\n\n  // Bioluminescent Physarum gold/amber core with cyan chemotaxis trail halo\n  vec3 trailHalo = vec3(0.08, 0.42, 0.52) * pow(clamp(density, 0.0, 1.0), 0.7) * 0.65;\n  vec3 veinGold = vec3(1.15, 0.78, 0.18) * pow(clamp(density, 0.0, 1.4), 1.35);\n  vec3 veinCore = vec3(1.45, 1.28, 0.72) * smoothstep(0.62, 1.35, density) * 0.85;\n  vec3 sparkCol = vec3(0.45, 1.0, 0.85) * agents * 0.85;\n  vec3 foodCol = vec3(0.28, 0.92, 1.15) * nodeCore * max(P_NODE_GLOW, 0.0) * 1.1;\n\n  vec3 col = bg + trailHalo + veinGold + veinCore + sparkCol + foodCol;\n\n  // Faint petri dish rim\n  float rim = smoothstep(0.012, 0.0, abs(length(uv) - 0.46));\n  col += vec3(0.14, 0.24, 0.32) * rim * 0.4;\n\n  fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);\n}",
   "execution_fidelity": "conceptual-diagram",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-30",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "physarum-transport-networks",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-30T16:50:13.852Z",
     "renderer": "Chromium 145.0.7632.6 headless, WebGL2 via ANGLE/SwiftShader, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.493,
      "std": 0.2435,
      "unique_colors": 479
     },
     "image": "/specimens/physarum-transport-networks-live.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "boids",
  "gray-scott-reaction-diffusion",
  "chaotic-attractor-density-rendering"
 ],
 "extends": [],
 "supersedes": [],
 "combines_with": [],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/simulation/physarum-transport-networks.json"
 },
 "solves": [
  "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"
 ],
 "authority": "Jones, 2010",
 "url": "https://texelatlas.vercel.app/t/physarum-transport-networks/",
 "execution_fidelity": "conceptual-diagram",
 "fidelity_label": "Visual Diagram",
 "benchmark_eligible": false,
 "gpu_weight": {
  "weight_x": 23.08,
  "tier": "heavy",
  "p50_ms": 0.7593,
  "p95_ms": 0.8363,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 40,
  "preset_id": "physarum-transport-networks-live",
  "execution_fidelity": "conceptual-diagram",
  "fidelity_label": "Visual Diagram",
  "benchmark_eligible": false,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 23.07,
   "tier": "heavy",
   "p50_ms": 0.3668,
   "p95_ms": 0.3705,
   "speedup_x": 2.07,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 15.05,
   "tier": "moderate",
   "p50_ms": 0.4335,
   "p95_ms": 0.4337,
   "speedup_x": 1.75,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}