Skip to content

Optimization of traffic flow in a road network using MATLAB's Genetic Algorithm. Applied to a nonlinear objective function with equality constraints

Notifications You must be signed in to change notification settings

panoskoutris/genetic-algorithm-for-network-optimization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Genetic Algorithm for Network Optimization

Optimization of traffic flow in a road network using MATLAB’s Genetic Algorithm, applied to a nonlinear objective function with flow conservation and capacity constraints.

Developed as part of the course Optimization Techniques at the Aristotle University of Thessaloniki (AUTH), School of Electrical & Computer Engineering.


Problem Overview

A traffic network with 9 intersections (nodes) and 17 roads (edges) is modeled. Each road has a specific capacity and a congestion-sensitive travel time. The objective is to minimize the total travel time per vehicle by distributing traffic optimally, while satisfying:

  • Flow conservation at all internal nodes
  • Inflow = outflow condition
  • Per-road capacity limits

Network Diagram

Traffic Network

Red numbers indicate road capacity ( c_i ) (vehicles/min). Each arrow represents a one-way traffic path between intersections.


Travel Time Function

The delay for road (i) is modeled by the nonlinear function:

Ti(xi)

Where:

  • ( t_i ): base (uncongested) travel time
  • ( a_i ): congestion factor
  • ( x_i ): flow on road (i)
  • ( c_i ): road capacity

The total network cost is:

f(x) = βˆ‘α΅’ xα΅’ Β· Tα΅’(xα΅’)


Methodology

We solve the nonlinear constrained optimization problem using MATLAB’s built-in Genetic Algorithm (ga). This choice is robust to local minima and does not require gradient information.

Constraints

  • Linear equality constraints: Aβ‚‘q Β· x = bβ‚‘q
  • Bound constraints: 0 β‰€ xα΅’ β‰€ cα΅’
  • Flow conservation is built into Aeq, beq

Experiments

Baseline Optimization

  • File: optimize_flow_baseline.m
  • Traffic inflow: ( V = 100 ) vehicles/min

Robustness Analysis

  • File: optimize_flow_variable_V.m
  • Tested inflows: ( V = 85, 95, 105, 115 )
  • For each V, the GA is run and convergence plots are generated.

Repository Structure

genetic-algorithm-for-network-optimization
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ travel_time_objective.m # Objective function f(x)
β”‚ β”œβ”€β”€ optimize_flow_baseline.m # GA run for V = 100
β”‚ └── optimize_flow_variable_V.m # GA runs for V ∈ {85, 95, 105, 115}
β”œβ”€β”€ images/
β”‚ β”œβ”€β”€ network_diagram.png # Network structure
β”‚ └── Ti(xi).png # Travel time function 
β”œβ”€β”€ report.pdf # Project report with equations and results
└── README.md

Tools Used

  • MATLAB
  • Optimization Toolbox
  • Global Optimization Toolbox

Author

Panagiotis Koutris
Undergraduate at AUTH – School of Electrical & Computer Engineering


License

Licensed under the Apache 2.0 License.

About

Optimization of traffic flow in a road network using MATLAB's Genetic Algorithm. Applied to a nonlinear objective function with equality constraints

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages