Please sign in to access this page

Optimal Bus Route

Optimal Bus Route Used AI

8 devlogs
11h 20m

Using Graph Theory and a Genetic Algorithm to compute near-optimal bus routes. Used bus stop locations in Mumbai and real-time traffic data.

Timeline

Ship 1

0 payouts of shell 0 shells

Divyam Seksaria

about 1 month ago

Divyam Seksaria Covers 8 devlogs and 11h 20m

Instead of google maps API used Here API matrix (ran out of google maps credit) to compute traffic times between bus stops. Changed the code for efficiency as to not needing to calculate 700! possibilites. Finally calculated best path (red arrow) and graphed it all on graphistry. For now used a sample of only 100 bus stops (all bus stops coming soon)

Update attachment

Added a cache for the duration and the bus stops (which are pulled from google maps) so an API call doesnt need to be requested repeatedly. Also switched from using Jaal to graphistry as it allows colouring the best path and has a better UI. Finally, broke down the map of mumbai into small chunks to avoid the max requests limit.

Update attachment

Find out that genetic algorithms would work best for this and implemented it to find out closest to optimal path from random combinations of known bus stops

Update attachment

Trying out shortest path algorithms. Made a graph class for organisation

Update attachment

Added all the bus-stops in a radius to the graph and the time it will take to travel between each from google maps.

Update attachment

Used the Places API to find all bus stops in a circle given the centre and the radius and the details of the bus stop like name and location

Update attachment

Used the google distance matrix API to pull the distance and time between 2 locations

Update attachment

Created a directional weighted graph using Jaal and networkx

Update attachment