Skip to main content

Traffic Optimizer

Intersections, corridors, and whole-city signal timings — flow conservation as an NM27 invariant, entropy as a congestion metric, scheduling as CS43.

  • Live appzeq.dev/apps/traffic-optimizer/
  • Sourceapps/zeq-me/public/apps/_in-development/traffic-optimizer/ (1,775 lines)
  • Operators — KO42 · NM27 (flow conservation) · CS43 · CS47 (entropy)
  • Error budget — ≤ 0.1% on Webster optimal cycle time for canonical intersection

What it solves

A traffic-signal workbench. Three modes:

  • Single intersection — Webster cycle optimisation; green-time split minimising average delay
  • Corridor — green-wave progression on a sequence of signals; bandwidth maximisation
  • Grid — microscopic simulation with flow-conservation constraints at every node; adaptive signal control

KO42 contributes a 1.287 Hz phase alignment across signals so grid-wide coordination is exact, not drifting — particularly useful for corridor green-waves.


The math

NM27 ∑ q_in = ∑ q_out (flow conservation at each intersection)
Webster cycle C₀ = (1.5 L + 5) / (1 − Y) (optimal cycle time)
Webster delay d = (c (1 − λ)²) / (2 (1 − λ x)) + x² / (2 q (1 − x))
CS43 T(n) = O(n log n) (signal-plan search)
CS47 H = −∑ p_i log p_i (congestion entropy over links)

Operator picks

StepDecision
1. PrimeKO42 on
2. LimitKO42 + NM27 + CS43 + CS47 = 4 operators (at limit)
3. ScaleHuman-scale, discrete-vehicle continuum
4. Precision≤ 0.1% on Webster cycle
5. CompileC_KO42 + C_NM27 + C_CS43 + C_CS47
6. ExecuteZ encodes arrival rates, saturation flows, link topology
7. VerifyWebster optimum match to 3 sig figs

Runnable worked example — single intersection Webster optimum

Four-phase intersection, lost time L = 12 s, critical flow ratios [0.25, 0.30, 0.20, 0.15]. Published Webster C₀ ≈ 117.6 s.

Webster-optimum signal timing is computed inside the traffic-optimizer app itself — open the live app, enter the intersection parameters, and read the optimal cycle length with its proof:

  • Live app — open the optimizer, enter lost time L = 12 s and the four critical flow ratios [0.25, 0.30, 0.20, 0.15].
  • Result — an envelope carrying value (the optimal cycle length), the chosen operators, the equations, and a zeqProof digest any node can recompute.

Compare the returned cycle length against the published Webster optimum (C₀ ≈ 117.6 s) yourself — the proof in the envelope is what makes the answer trustworthy, not the digits.


Extend it

  1. Arterial green-wave — chain N signals at common cycle C; maximise bandwidth via mixed-integer search
  2. Transit signal priority — bus arrivals as CS47 entropy spikes; extend or truncate green adaptively
  3. Stochastic demand — Poisson arrivals, verify Webster still holds via Monte Carlo

Seeds

  • Autonomous intersection management — no signals, just NM27 flow-conservation constraints among AVs
  • Urban-air-mobility corridors — lift the grid into 3D; treat vertiport approaches as signalised nodes
  • Evacuation routing under disaster scenarios; couple to the Weather app's Early Warning System

Papers

Middleware active. Kernel on the 1.287 Hz HulyaPulse. Awaiting next Zeqond.