Git Product home page Git Product logo

prague-public-transport-connection-search's Introduction

Prague public transport connection search

Contains all metro, tram and non-regional bus lines. It doesn't take into account specific day, only time of the day.

To use this search, clone this repo and build and run the only cmake target available ConnectionSearch. I recommend using the release mode since loading all the data takes a little while.

The usage is pretty straightforward - enter the name of the start stop, end stop and the departure time and you'll get the connection if it exists. If you enter just a part of the stop name, you might get a hint of the name you want.

Documentation

The search uses Raptor algorithm presented at https://www.microsoft.com/en-us/research/wp-content/uploads/2012/01/raptor_alenex.pdf or in longer version at https://renatowerneck.files.wordpress.com/2016/06/dpw14-raptor.pdf. The most important thing about the algorithm is that it is not based on Dijkstra algorithm or a graph, but it takes advantage of the GTFS format of the data (https://developers.google.com/transit/gtfs/reference/).

The specific data included in this project come from Prague public transport (available with some documentation at https://pid.cz/o-systemu/opendata/), but the data were preprocessed and transformed for my purposes.

In order to understand how this program really works, it is kind of necessary to read about the Raptor algorithm and about the GTFS format, but I tried to provide a lot of comments in the code, so you can at least have a general idea of how it works.

Also, following is some information about all source files:

DataTypes.hpp, Route.cpp

  • These files contain Stop, Route and Trip classes, which are essential terms in GTFS

Timetable.hpp, Timetable.cpp

  • Timetable class - provides an interface for getting all the data (the stops, routes, trips and other stuff)

Raptor.hpp, Raptor.cpp

  • Raptor class - this class does the whole search, recreates the connection (gets all the lines used) and shows the result

InputReader.hpp, InputReader.cpp

  • InputReader class - reads and takes care of all user input

main.cpp

  • the entry point, just merges everything together

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.