/Traffic-Signal-Optimization

Project to improve the efficiency of traffic signal control and reduce traffic delay at intersections by using various optimization algorithms.

Primary LanguagePython

Traffic Signal Optimization

This project is an attempt to improve the efficiency of traffic signal control and reduce traffic delay at intersections by using various optimization algorithms like Ant Colony Optimization algorithm (ACO) and Genetic algorithm (GA). The objective is to optimize signal timings at isolated signals and coordinated signals, such that the traffic network efficiency is improved, and traffic delays are reduced.

Implemented algorithms

  • Ant Colony Algorithm
  • Genetic Algorithm

Requirements

  • Install Git
  • Install Python3
  • Run pip install requirements.txt to install Numpy, Matplotlib, Tkinter

It is better to install the above requirements in a virtual environment

Create a virtual environment

  • Run pip install virtualenv to install virtualenv module
  • Create a new virtual environment using virtualenv myenv
  • Use virtualenv -p /usr/bin/python3 myenv to specify Python3 as the default interpreter
  • Activate the virtual environment with source myenv/bin/activate
  • Deactivate the virtual environment with deactivate

Usage

  • Clone the repository using git clone https://github.com/Abhirams2020/Traffic-Signal-Optimization.git
  • Run python3 main.py to see the results.

Results

alt text

Locations used

Country Code Latitude Longitude
AD 42.54625 1.601554
AE 23.42408 53.84782
AF 33.93911 67.70995
AG 17.06082 -61.7964
AI 18.22055 -63.0686
AL 41.15333 20.16833
AM 40.0691 45.03819
AN 12.22608 -69.0601
AO -11.2027 17.87389
AQ -75.251 -0.07139
AR -38.4161 -63.6167
AS -14.271 -170.132
AT 47.51623 14.55007
AU -25.2744 133.7751
AW 12.52111 -69.9683
AZ 40.14311 47.57693
BA 43.91589 17.67908
BB 13.19389 -59.5432
BD 23.68499 90.35633
BE 50.50389 4.469936
BF 12.23833 -1.56159
BG 42.73388 25.48583
BH 25.93041 50.63777
BI -3.37306 29.91889
BJ 9.30769 2.315834
BM 32.32138 -64.7574
BN 4.535277 114.7277
BO -16.2902 -63.5887
BR -14.235 -51.9253
BS 25.03428 -77.3963
BT 27.51416 90.4336
BV -54.4232 3.413194
BW -22.3285 24.68487
BY 53.70981 27.95339
BZ 17.18988 -88.4977
CA 56.13037 -106.347
CC -12.1642 96.87096
CD -4.03833 21.75866
CF 6.611111 20.93944
CG -0.22802 15.82766
CH 46.81819 8.227512
CI 7.539989 -5.54708
CK -21.2367 -159.778
CL -35.6751 -71.543
CM 7.369722 12.35472
CN 35.86166 104.1954
CO 4.570868 -74.2973
CR 9.748917 -83.7534
CU 21.52176 -77.7812
CV 16.00208 -24.0132
CX -10.4475 105.6904
CY 35.12641 33.42986
CZ 49.81749 15.47296
DE 51.16569 10.45153
DJ 11.82514 42.59028
DK 56.26392 9.501785
DM 15.415 -61.371
DO 18.73569 -70.1627
DZ 28.03389 1.659626
EC -1.83124 -78.1834
EE 58.59527 25.01361
EG 26.82055 30.8025
EH 24.21553 -12.8858
ER 15.17938 39.78233
ES 40.46367 -3.74922
ET 9.145 40.48967
FI 61.92411 25.74815
FJ -16.5782 179.4144
FK -51.7963 -59.5236
FM 7.425554 150.5508
FO 61.89264 -6.91181
FR 46.22764 2.213749
GA -0.80369 11.60944
GB 55.37805 -3.43597
GD 12.26278 -61.6042
GE 42.31541 43.35689
GF 3.933889 -53.1258
GG 49.46569 -2.58528
GH 7.946527 -1.02319
GI 36.13774 -5.34537
GL 71.70694 -42.6043
GM 13.44318 -15.3101
GN 9.945587 -9.69665
GP 16.99597 -62.0676
GQ 1.650801 10.2679
GR 39.07421 21.82431
GS -54.4296 -36.5879
GT 15.78347 -90.2308
GU 13.4443 144.7937
GW 11.80375 -15.1804
GY 4.860416 -58.9302
GZ 31.35468 34.30883
HK 22.39643 114.1095
HM -53.0818 73.50416
HN 15.2 -86.2419
HR 45.1 15.2
HT 18.97119 -72.2852
HU 47.16249 19.5033
ID -0.78928 113.9213
IE 53.41291 -8.24389
IL 31.04605 34.85161
IM 54.23611 -4.54806
IN 20.59368 78.96288
IO -6.34319 71.87652
IQ 33.22319 43.67929
IR 32.42791 53.68805
IS 64.96305 -19.0208
IT 41.87194 12.56738
JE 49.21444 -2.13125
JM 18.10958 -77.2975
JO 30.58516 36.23841
JP 36.20482 138.2529
KE -0.02356 37.90619
KG 41.20438 74.7661
KH 12.56568 104.991
KI -3.37042 -168.734
KM -11.875 43.87222
KN 17.35782 -62.783
KP 40.33985 127.5101
KR 35.90776 127.7669
KW 29.31166 47.48177
KY 19.51347 -80.567
KZ 48.01957 66.92368
LA 19.85627 102.4955
LB 33.85472 35.86229
LC 13.90944 -60.9789
LI 47.166 9.555373
LK 7.873054 80.7718
LR 6.428055 -9.4295
LS -29.61 28.23361
LT 55.16944 23.88128
LU 49.81527 6.129583
LV 56.87964 24.60319
LY 26.3351 17.22833
MA 31.7917 -7.09262
MC 43.7503 7.412841
MD 47.41163 28.36989
ME 42.70868 19.37439
MG -18.7669 46.86911
MH 7.131474 171.1845
MK 41.60864 21.74528
ML 17.57069 -3.99617
MM 21.91397 95.95622
MN 46.8625 103.8467
MO 22.19875 113.5439
MP 17.33083 145.3847
MQ 14.64153 -61.0242
MR 21.00789 -10.9408
MS 16.7425 -62.1874
MT 35.9375 14.37542
MU -20.3484 57.55215
MV 3.202778 73.22068
MW -13.2543 34.30153
MX 23.6345 -102.553
MY 4.210484 101.9758
MZ -18.6657 35.52956
NA -22.9576 18.49041
NC -20.9043 165.618
NE 17.60779 8.081666
NF -29.0408 167.9547
NG 9.081999 8.675277
NI 12.86542 -85.2072
NL 52.13263 5.291266
NO 60.47202 8.468946
NP 28.39486 84.12401
NR -0.52278 166.9315
NU -19.0544 -169.867
NZ -40.9006 174.886
OM 21.51258 55.92326
PA 8.537981 -80.7821
PE -9.18997 -75.0152
PF -17.6797 -149.407
PG -6.31499 143.9556
PH 12.87972 121.774
PK 30.37532 69.34512
PL 51.91944 19.14514
PM 46.94194 -56.2711
PN -24.7036 -127.439
PR 18.22083 -66.5901
PS 31.95216 35.23315
PT 39.39987 -8.22445
PW 7.51498 134.5825
PY -23.4425 -58.4438
QA 25.35483 51.18388
RE -21.1151 55.53638
RO 45.94316 24.96676
RS 44.01652 21.00586
RU 61.52401 105.3188
RW -1.94028 29.87389
SA 23.88594 45.07916
SB -9.64571 160.1562
SC -4.67957 55.49198
SD 12.86281 30.21764
SE 60.12816 18.6435
SG 1.352083 103.8198
SH -24.1435 -10.0307
SI 46.15124 14.99546
SJ 77.5536 23.67027
SK 48.66903 19.69902
SL 8.460555 -11.7799
SM 43.94236 12.45778
SN 14.4974 -14.4524
SO 5.152149 46.19962
SR 3.919305 -56.0278
ST 0.18636 6.613081
SV 13.79419 -88.8965
SY 34.80208 38.99682
SZ -26.5225 31.46587
TC 21.69403 -71.7979
TD 15.45417 18.73221
TF -49.2804 69.34856
TG 8.619543 0.824782
TH 15.87003 100.9925
TJ 38.86103 71.27609
TK -8.96736 -171.856
TL -8.87422 125.7275
TM 38.96972 59.55628
TN 33.88692 9.537499
TO -21.179 -175.198
TR 38.96375 35.24332
TT 10.6918 -61.2225
TV -7.10954 177.6493
TW 23.69781 120.9605
TZ -6.36903 34.88882
UA 48.37943 31.16558
UG 1.373333 32.29028
US 37.09024 -95.7129
UY -32.5228 -55.7658
UZ 41.37749 64.58526
VA 41.90292 12.45339
VC 12.98431 -61.2872
VE 6.42375 -66.5897
VG 18.4207 -64.64
VI 18.33577 -64.8963
VN 14.05832 108.2772
VU -15.3767 166.9592
WF -13.7688 -177.156
WS -13.759 -172.105
XK 42.60264 20.90298
YE 15.55273 48.51639
YT -12.8275 45.16624
ZA -30.5595 22.93751
ZM -13.1339 27.84933
ZW -19.0154 29.15486