| North | East | South | West | |
| In | ||||
| Out |
| North | East | South | West | |
| Rules |
Lane Direction in Intersection
Flow in an Intersection based on Max Entropy
This tool is part of an Ideal Flow Network (IFN) "virtual lab" that lets you act as a traffic engineer. Your goal is to design a 4-way intersection and find the most efficient traffic signal plan to keep cars moving safely and prevent gridlock.
This lab is a powerful educational tool to explore the complex trade-offs in traffic signal design. You will:
A Note on Assumptions: This is an advanced simulation, but still a model. It assumes a 4-way intersection and uses established traffic engineering formulas (like Maximum Entropy for flow and Webster's formula for timing). The results are an excellent approximation but are not a substitute for a full-scale professional study with site-specific data.
The fastest way to see the lab's power is to jump right in. Let's find the "best" signal plan in 60 seconds.
That's it! You've just run a comprehensive optimization. Keep reading to understand how it all works, what the different knobs do, and how to manually design and fix a "failing" intersection.
This tab lets you define the physical geometry of your intersection. Changes here will dramatically affect the results.
This defines the number of lanes for each approach (North, East, South, West) going In (approaching the signal) and Out (exiting the intersection). The "In" lanes are the most critical for signal timing.
This is the most important setting in this tab. It tells drivers what turns are allowed from each "In" lane.
L = Turn LeftS = Go StraightR = Turn Right
Lanes are separated by a | pipe. For example, a 3-lane
road with the rule L|S|SR means:
This is a critical, fundamental setting that changes the core logic of what a "conflict" is.
This tab shows you the traffic problem you need to solve. You can either let the lab generate traffic for you, or you can input your own.
Think of this as the "top speed" of a single lane. It's the maximum number of cars that can pass through one lane in one hour if the light was always green. A value of 1800-2000 is a common standard.
The "Origin-Destination" table summarizes the total flow from each origin road (e.g., North) to each destination road (e.g., South).
This is the main "sandbox" where you will do most of your work. Here you set the rules for the signal and optimization.
A conflict is any time two vehicle paths could cross or interfere. The entire goal of a traffic signal is to separate conflicts into different "phases" (green light times).
This is a vital "anti-gridlock" feature.
A "Spillback" is when your intersection's traffic jam (the "queue") gets so long that it spills backward and blocks the next intersection, causing total gridlock.
Checking "Allow Platoon Constraint" tells the optimizer: "Do not let a green light run so long that it causes a spillback." It will cap the green time based on the "Mid Block Dist" (the distance, in meters, to the next intersection upstream).
After you run an optimization, four sections update with data.
This is a text summary of your signal plan. It lists each Phase, the movements in it, and the "Critical Flow"—the one movement that needs the most green time, which determines the green time for the whole phase.
This shows you WHAT is in each phase.
This shows you WHEN each movement runs. It's a Gantt chart (a timeline) of the full cycle, showing exactly how many seconds are given to Green, Yellow, and Red for every single movement.
This is your report card. It tells you how well your plan works.
A Phase is a set of one or more traffic movements that can all get a green light at the same time without conflicting.
The core problem of signal timing is to find the minimum number of phases to serve all movements, which minimizes the "lost time" from yellow/red lights.
This problem can be modeled as a "graph theory" problem. Imagine each movement (e.g., "North-Left") is a "node".
Both methods solve the same problem. Since finding the perfect solution is extremely hard (NP-hard), the lab uses fast "greedy heuristics" to find a very good, near-optimal plan.
| Algorithm (in UI) | Graph Type | Problem Solved | Heuristic / Method | Result |
|---|---|---|---|---|
Flow-Aware Clique CoverPhaseOptimizerFlowAwareCliqueCover
|
Compatibility Graph | Minimum Clique Cover (Flow-Weighted) | Greedy (First-Fit, prioritized by flow volume). | Standard Engineering: Produces a valid, near-optimal plan that prioritizes high-flow movements to minimize delay. |
Protected-Permitted OptimizerPhaseOptimizerProtectedPermitted
|
Compatibility Graph | Minimum Clique Cover (Hybrid) | Hybrid. Creates phases for protected movements, then adds permitted movements based on flow (v/c) ratios. | Standard Engineering: Produces a complex, realistic, flow-aware plan separating protected and permitted turns. |
NEMA 8-PhasePhaseOptimizerNEMA
|
N/A (Fixed Logic) | N/A (Applies standard) | Applies the fixed, 8-phase "Ring-and-Barrier" logic used by real-world signal controllers. | Standard Engineering: The most common, stable, and reliable plan. Not always the most efficient, but very predictable. |
Min Clique CoverPhaseOptimizerCliqueCover
|
Compatibility Graph | Minimum Clique Cover | Greedy (First-Fit by compatibility degree). Flow-ignorant. | Geometric: Produces a valid, near-optimal phase plan based only on geometry. |
Graph ColoringPhaseOptimizerColorGraph
|
Conflict Graph | Minimum Graph Coloring | Greedy (First-Fit by conflict degree). Flow-ignorant. | Geometric: Produces a valid, near-optimal phase plan based only on geometry. |
Conflict GraphPhaseOptimizerConflictGraph
|
Conflict Graph | Minimum Graph Coloring | Welsh-Powell (assigns lowest available color). Flow-ignorant. | Geometric: Produces a valid, near-optimal phase plan. |
Max CliquePhaseOptimizerMaxClique
|
Compatibility Graph | Maximal Clique Enumeration | Bron-Kerbosch (Finds all maximal cliques). | Academic: Does NOT produce a valid plan. It lists all possible valid phases, resulting in many redundant "phases" and invalid timings. |
This algorithm implements the standard NEMA (National Electrical Manufacturers Association) 8-Phase sequencing.
Unlike the graph-based algorithms ("Clique Cover", etc.) which find phases from scratch, this algorithm applies a hard-coded, industry-standard phase structure.
A NEMA controller uses a "ring-and-barrier" logic to run non-conflicting phases concurrently (at the same time).
This simulation models a standard "dual-ring" setup:
The green time for each step is determined by the "critical" movement in the pair. For example, the green time for Step 1 is `max(Green Needed for Phase1, Green Needed for Phase5)`. This is a highly efficient and standard way to time an intersection.
You are right to notice the difference! They are two different types of diagrams that show two different things:
The NEMA diagram is a logic-based flowchart, not a geometric one. The boxes represent the phases themselves (Phase 1, Phase 2, etc.).
A Ring is a sequence of conflicting phases that must run one after another.
Phases in the same ring cannot run at the same time (e.g., Phase 1 and Phase 2 conflict).
A Barrier is a mandatory stop point. All phases in all rings must end before any phase after the barrier can begin.
Phases that are in different rings but in the same row (between the same barriers) can run at the same time.
In short, the Arrow diagrams show you the contents of each box. The NEMA (box) diagram shows you the rules for how to run those boxes in order.
So your plan has a Level of Service 'F' or a "FAIL (Spillback Risk)". How do you fix it?
This is the real job of a traffic engineer. You have four main solutions to try.
The simplest fix. Go to the "IntersectionDesign" tab. Change the "In" lanes from 2 to 3 on the failing road. More lanes = more capacity.
This is usually the best answer. Look at your
"Lane Direction Rules". Do you have a rule like
LSR|S?
This is a "shared" lane, and it's terrible. The cars turning Left (L) will block all the cars trying to go Straight (S).
The Fix: Go to "IntersectionDesign", change "In"
lanes from 2 to 3, and change the rule to
L|S|R. Now every movement has its
own dedicated lane. This removes conflicts and dramatically
improves flow.
Go to "Signal Timing". Try a longer "Cycle Time" (e.g., 140 instead of 120). This gives more total green time to everyone, but also makes people wait longer, which can make queues worse. It's a trade-off.
Sometimes, pedestrians are the problem. Go to the "Signal Timing" tab and look at your "Pedestrian" settings.
Is the "Ped. Min. Time" (e.g., 22s) longer than the green time the parallel cars actually need?
If so, the pedestrians are forcing the green light to stay on longer than needed. This "wasted" green time increases delay for everyone else and can cause spillback.
This gives you a perfect "engineering warrant" to recommend building a pedestrian bridge or underpass (a "grade-separated crossing") to remove the conflict entirely. Try unchecking the Pedestrian box and see how much the LOS improves!
In the "Signal Timing Diagram" summary, you may see a message like:
Cycle Time: 48.0s (Target: 25s)
If they are different, it means the target was impossible to meet. This can happen for two reasons:
This is an educational tool, not a professional design product.
While this tool uses correct, standard-practice traffic engineering formulas, it is for education and research dissemination only. The real design of an optimum traffic signal requires much larger consideration, including site-specific data collection, actuated control logic, detector placement, and detailed microscopic simulation.
The results from this tool should not be used for any real-world traffic signal design or implementation without validation by a qualified traffic engineer.
If you find any bugs or problem, or simply just want to appreciate the work I am doing, please do not hesitate to contact me. I also accept donation.