110 likes | 230 Views
Traffic errr. Chris Meyers. Scenario 1. You want the shortest time path to work today Static, pre-computed Grab all paths from A -> B Google maps Find the fastest path based on users who have previously traveled that path. Route 1. Route 2. Route 3. Scenario 2.
E N D
Traffic errr Chris Meyers
Scenario 1 • You want the shortest time path to work today • Static, pre-computed • Grab all paths from A -> B • Google maps • Find the fastest path based on users who have previously traveled that path
Scenario 2 • You want the shortest time path to work today, from your 3 pre-planed routes • Find the fastest path based on users who have recently traveled that path
Tracking 1 • Constantly check what road the user is on • When you find a road that the user is on remember it (road_curr) • When the user turns off the road, onto a new road, log the time spent on the old road segment. Also log a timestamp • <segmentId, road, timestamp>
Fastest Route 1 • Get all paths from A->B • {<segId1, segId2,…>, <segId1, segId2, …>, …} • For each path <segId1, segId2,…> grab the corresponding logs <segmentId, road, timestamp> • Do some calculations • Sum up all time segments on the path • Choose smallest time as the path
Tracking 2 • Constantly check what road the user is on • When you find a road that the user is on remember it (road_curr) • When the user turns off the road, onto a new road, log the time spent on the old road segment. Factor the new time in with the running time
Fastest Route 2 • Get all paths from A->B • {<segId1, segId2,…>, <segId1, segId2, …>, …} • For each path <segId1, segId2,…> lookup the running time • Sum up all time segments on the path • Choose smallest time as the path
The End Questions ?