Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bus public transport algorithm

Tags:

I am working on an offline C# application that can find bus routes. I can extract the timetable/bus/route data. I am searching for the most simple solution that will work with basic data.

What algorithm can be used to find a route from bus stop "A" to bus stop "B"? Is there a open-source solution ready for C#/Java? Is the google GTFS format for database good for a simple solution? http://code.google.com/transit/spec/transit_feed_specification.html

Thanks for any help. I am stuck with this. I don't know where to start - how to store the data and how to find routes. I know about Dijkstra/A* but I have used them only on graphs that were not time dependent...

like image 568
Daniel Novak Avatar asked Sep 02 '10 15:09

Daniel Novak


People also ask

Which of the following algorithms are used for finding the shortest path in an urban transportation network?

For large networks, the standard shortest path algorithms - Dijkstra's algorithm (1959) and Bellman's algorithm (1958)- are too slow. Consequently, faster algorithms have been designed to speed up the search.

How does real time bus tracking work?

The data is sent to central servers via cellular networks and GPS Satellite networks which will perform all computations and store each bus position in the database. This information stored on the cloud will then be retrieved by users through fleet management software or Android applications.

Is there an app that tells you where the bus is?

Moovit is the world's #1 urban mobility app. All local transit options in one app: buses, trains, subway, bikes, scooters, Uber, Lyft, and more. Plan, pay, and ride. Moovit is one app for all your urban mobility and transit rides.


1 Answers

The problem you are working on is not a trivial task. So much so, that is has a name: the mixed integer nonlinear programming problem (MINLP). In the words of one author (Deb 1998):

"When formulated mathematically, the time scheduling problem becomes a mixed integer nonlinear programming problem (MINLP) having a large number of resource- and service-related constraints. Although attempts have been made in the past to find an optimal schedule of a simplified model using classical optimization techniques (Bookbinder & DCsilets, 1992; Kikuchi & Parameswaran, 1993), it is observed that this is an extremely difficult task even for a small transit network. The difficulty arises mainly because of the large number of variables and constraints, discrete nature of variables, and nonlinearities involved in the objective function and the constraints."

In Deb's paper he proposes a genetic algorithm.

Your other option would be to use simulation. Just to throw something out there you can try right away-- choose thousands of random routes that start at your origin, and fish out the ones that work reasonably well at getting to the destination.

Picture the algorithm like this: You are trying to find the quickest route from stop A to stop B, starting at a certain time. You hire 1,000 people and arm them with a quarter to flip. You tell them to flip the coin every time they have a chance to get on or off a bus. Heads, get off (or get on, if already off). Tails, stay on (or keep waiting, if off). They each have an index card to write down the choices they make as they go. You go to point B and wait for the first guy to show up and take his card.

like image 194
Pete Avatar answered Sep 21 '22 10:09

Pete