Skip to content

otina12/google-maps-optimized-walking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Human Optimized Walking

Idea

Maps are very good at optimizing routes for cars. They use traffic data, congestion, road types, and real time conditions.

But with walking it's different.

A person usually walks at a constant speed. There are no traffic jams for walking. The only real thing that stops a person is traffic lights.

Because of the traffic lights, the shortest route may not always be the fastest one.

So the idea is simple: If a system knows your average walking speed, where traffic lights are, and how long red and green lights last, it can choose a path that reduces your waiting time.

Project

This project assumes that all the required data is known, and implements the logic for time-based walking route optimization using traffic light cycles and constant human walking speed.

It uses Dijkstra’s algorithm with a wait time penalty at red lights to find the fastest path, and Breadth-first Search to simulate all paths for visualization.

Assumptions

We also assume that:

  • person walks at a constant average speed
  • traffic lights have fixed green and red cycles (no sensors or pedestrian buttons and etc.)
  • route is flat (no stairs, slopes and etc.)
  • person is a Law Abiding Citizen and follows traffic rules
  • person does not start crossing the road if they cannot reach the other side before the light turns red (no crossing at the orange light)
  • map graph is a Directed Acyclic Graph (for the sake of simplicity)

How to run

1. Clone the repo

git clone https://github.com/Otina12/google-maps-optimized-walking
cd google-maps-optimized-walking

2. Create and activate a virtual environment

Windows PowerShell:

python -m venv venv
.\venv\Scripts\Activate.ps1

macOS or Linux:

python3 -m venv venv
source venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

4. Run the project

From the project root:

cd src/demo
python main.py

How to create your own example

Points

Edit input/points.txt:

point,x,y
A,1420,1290
B,1440,1240

Edges

Edit input/edges.txt.

source,target,green_time,red_time,cycle_offset
A,B,20,60,0
A,E,0,0,0

Important: Edges should form a Directed Acyclic Graph.

Images

Update images at these paths:

Output

After running, the simulator generates:

  • an mp4 video
  • an animated webp

Limitations and possible improvements

This project is a simplified model and does not fully represent real-world walking conditions.

Things not considered:

  • traffic lights are often adaptive and not fixed cycle
  • pedestrian phases are different from car green phases
  • push button crossings and sensor based lights
  • variable walking speed due to slope, stairs, surface, weather, or crowd density
  • sidewalk quality, safety, lighting, and accessibility
  • real world map inaccuracies and construction

Possible improvements:

  • use probabilistic wait times instead of fixed waits
  • add uncertainty and expected time instead of single time values
  • add user preferences such as safety, accessibility, or fewer crossings

Notes

The example input uses a real map route in Tbilisi, Georgia from Point A to Point B. Traffic light positions, timings and cycles are close to actual values.

This is only a concept project. It shows that walking navigation can easily be improved.

About

The shortest path is not always the fastest one on real roads. This project uses Dijkstra's algorithm with a red light wait penalty to find the quickest route, and BFS to simulate and visualize all paths using traffic light cycles and constant walking speed.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages