How to Simulate and Optimize Traffic Flow
Model urban road networks, configure signal timing, and simulate bottleneck mitigation techniques using open-source traffic simulation software on your computer.
- Read the tools, materials, safety notes, and steps below for free.
- Tap Start Camera Coach when you want hands-free voice help.
- Allow camera and microphone. Point your phone at the work; the coach watches your progress and tells you the next step.
๐งฐ Required Tools & Equipment
- โ Computer running Windows, macOS, or Linux
- โ Two-button scroll wheel mouse
- โ Dual-monitor setup or split-screen display
๐ฆ Materials & Supplies
- โ Open-source traffic simulation suite (SUMO or similar)
- โ OpenStreetMap road network export (.osm file)
- โ Intersection vehicle count datasheet
โ ๏ธ Safety Checkpoints & Warnings
- โข Maintain proper ergonomic wrist and screen alignment during extended simulation modeling.
- โข Do not test experimental driving maneuvers on real public roads; keep all testing strictly inside the software environment.
๐ Step-by-Step Guide (6 Steps)
Import Network Map Data
Launch the network editor tool and open your exported OpenStreetMap road network file. Select the target congested intersection and crop out surrounding unused periphery roads to conserve processing power. Verify all road segments, lanes, and directional arrows accurately reflect real-world layout.
- โข A clean multi-lane intersection appears on the viewport grid with clear blue road vectors.
- โข Unnecessary outlying nodes and dead-end spur tracks are removed.
- โข Importing an entire metropolitan area at once, causing severe render lag.
- โข Failing to verify one-way street directional flags.
Configure Lane Connectivity and Turning Lanes
Select the junction inspection tool and click each inbound lane. Draw connection lines from dedicated turn lanes to their matching outbound receiving lanes. Designate dedicated left-turn slip lanes to prevent straight-moving vehicles from blocking through-traffic.
- โข Colored directional arc lines connect each lane to valid exit lanes across the intersection box.
- โข No conflicting crossing paths share an unmanaged lane lane index.
- โข Leaving through-lanes merged with high-volume left-turn lanes.
- โข Allowing multiple inbound lanes to bottleneck into a single outbound lane without a merge taper.
Establish Signal Phases and Cycle Times
Open the traffic light logic panel for the junction node and switch from priority-based yielding to actuated signal control. Define green phases for opposing through-lanes, followed by protected turn phases and amber clearance intervals. Set minimum green times to 15 seconds and cycle lengths to 90 seconds.
- โข Phase timeline shows alternating green, yellow, and red blocks across all approach phases.
- โข Signal heads on the visual map show synchronized color changes during playback scrub.
- โข Omitting yellow clearance and all-red clearance intervals between conflicting phase changes.
- โข Setting green cycle times too short, causing high startup-lost time per vehicle.
Generate Traffic Demand Flows
Open the demand generator interface and input hourly vehicle rates based on peak-hour counts. Define vehicle distributions with 85% passenger cars, 10% heavy trucks, and 5% buses. Set route origins at the perimeter entrance edges and destinations at opposing exit gates.
- โข Vehicle flow data tables show populated hourly insertion volumes exceeding 1,200 vehicles per hour per lane.
- โข Route paths highlight brightly across the network diagram from edge to edge.
- โข Setting uniform vehicle speeds and reaction times, which prevents realistic phantom jam formation.
- โข Flooding the network at step zero rather than ramping up insertion rates smoothly.
Run Simulation and Benchmark Bottlenecks
Press the run button at 1.0x real-time speed to observe vehicle queues developing at the junction. Monitor the output dashboard for average vehicle delay, queue length, and throughput count. Note the exact time step and lane where standing wave shockwaves begin to propagate backward.
- โข Vehicles move smoothly through lanes, decelerating at red lights and accelerating on green.
- โข Live graphs display average vehicle speed and cumulative waiting time curves.
- โข Running the simulation at maximum speed without visual checks, missing micro-stalls.
- โข Stopping the test before the network reaches steady-state saturation.
Apply Optimization and Validate Throughput
Modify the junction design by either converting it to a multilane modern roundabout or implementing coordinated green wave offsets with adjacent nodes. Re-run the simulation under identical demand traffic volumes. Compare the resulting average travel time and delay metrics against your baseline benchmark.
- โข Side-by-side analytics show a reduction of at least 30% in cumulative vehicle wait time.
- โข Continuous vehicle movement through the junction with minimal standing queues.
- โข Changing traffic demand volume between tests, invalidating comparative baseline data.
- โข Creating lane weaving zones shorter than the required minimum merge distance.
Credit: inspired by an original tutorial by Wendover Productions โ watch the original on YouTube.
Don’t have everything?
- No SUMO (Simulation of Urban MObility)? Any open-source road traffic simulator or Cities: Skylines with traffic management mods
- No Dual-monitor setup? Single screen with split-window layout snapping