{"id":37142565,"url":"https://github.com/fafeitsch/simple-timetable-routing","last_synced_at":"2026-01-14T16:43:57.186Z","repository":{"id":57550418,"uuid":"302043886","full_name":"fafeitsch/simple-timetable-routing","owner":"fafeitsch","description":"A simple implementation of finding connections in small public transportation networks.","archived":false,"fork":false,"pushed_at":"2020-12-21T18:43:22.000Z","size":35,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-07-27T22:06:13.538Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fafeitsch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-07T13:24:00.000Z","updated_at":"2022-06-01T14:27:56.000Z","dependencies_parsed_at":"2022-09-10T06:10:46.537Z","dependency_job_id":null,"html_url":"https://github.com/fafeitsch/simple-timetable-routing","commit_stats":null,"previous_names":[],"tags_count":2,"template":null,"template_full_name":null,"purl":"pkg:github/fafeitsch/simple-timetable-routing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fafeitsch%2Fsimple-timetable-routing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fafeitsch%2Fsimple-timetable-routing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fafeitsch%2Fsimple-timetable-routing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fafeitsch%2Fsimple-timetable-routing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fafeitsch","download_url":"https://codeload.github.com/fafeitsch/simple-timetable-routing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fafeitsch%2Fsimple-timetable-routing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28426260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T16:43:56.345Z","updated_at":"2026-01-14T16:43:57.181Z","avatar_url":"https://github.com/fafeitsch.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Simple Timetable Routing\n===\n\nThis package provides a simple algorithm to compute\nfastest routes in public transportation networks. This project\nwas mainly meant as a study project to understand\nthe algorithm and to experiment with different data models\nfor public transportation networks in Go.\n\nThis implementation is **not** suited for production\nusage, it may still have bugs and is not at all optimized. As of now,\nthe implementation assumes a minimum change time at stations of five minutes.\nIt is planed to make this constant customizable.\n\nQuick Guide:\n---\n1. Define some stops with Id and name:\n    ```go\n    mainStation := NewStop(\"MS\",\"Main Station\")\n    docksAE := NewStop(\"DAE\",\"Docks A–E\")\n    docksFG := NewStop(\"DFG\", \"Docks F and G\")\n    historicMall := NewStop( \"HM\",\"Historic Mall\")\n    schusterStreet := NewStop(\"SS\",\"Schuster Street\")\n    marketPlace := NewStop(\"MP\", \"Market Place\")\n    airport := NewStop(\"AR\",\"Airport\")\n    northAvenue := NewStop(\"NA\",\"North Avenue\")\n    chalet := NewStop(\"CH\", \"Chalet\")\n    northEnd := NewStop(\"NE\" ,\"North End\")\n    ```\n2. Define your lines:\n    ```go\n    blueLine := \u0026Line{Id: \"#0000FF\", Name: \"Blue Line\", startStop: mainStation}\n    redLine := \u0026Line{Id: \"#FF0000\", Name: \"Red Line\", startStop: northEnd}\n    ```\n3. Define events on the stops:\n    ```go\n       mainStation.Events = []Event{\n         {Departure: \"8:02\", Line: blueLine, TravelTime: 2 * time.Minute, NextStop: northAvenue, LineSegment: blueLine.Segments[2]},\n         {Departure: \"8:05\", Line: redLine, TravelTime: 3 * time.Minute, NextStop: historicMall, LineSegment: redLine.Segments[0]}\n         ...\n       }   \n    ```\n4. Create a timetable and query it:\n    ```go\n       timetable := NewTimetable([]*Stop[mainstation, ...])\n       connection := timetable.query(historicMall, chalet, time.Now())\n    ```\n   \nImplementation Details\n---\n\nThe package implements the time-dependent variant of [Dijkstra's Algorithm](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm).\nThe time-dependent model is a classical solution for finding routes in public transportation networks.\nFor a thorough explanation see for example [this paper (\"Time-Dependent Route Planning\" by Daniel Delling and Dorothea Wagner)](https://i11www.iti.kit.edu/extra/publications/dw-tdrp-09.pdf).\n\nThe advantage of the time-dependent approach is that the original algorithm by Dijstrka must hardly be changed.\nThe first step is to build a graph that resembles the real network graph: Every station is represented by a vertex and\nif there is at least one line connecting two stations, then there is an edge between the stations in the graph.\n\nIn normal Dijstrka the weight of the edge *w(e)* is constant. In the time-dependent model, the weight\nchanges over time, thus we have a weight function of *w(e,t)* where t is the time. Given two stations\n*u* and *v* which are connected by lines *A* and *B*. If a train of line *A* departures at 14:30 and a train of line *B*\ndepartures at 14:40 and the travel time to *v* are three minutes for both lines, then\n*w((u,v), 14:25)* is eight minutes and *w((u,v), 14:39)* is four minutes.\n\nMy implementation is (at the moment) not focussed on performance, but rather was meant to be a\nworking method for route finding in public networks. Thus, my implementation does **neither** make use\nof fibonnaci heaps in the plain Dijsktra algorithm, **nor** is the implementation of *w(e,t)* very\nsophisticated. \n\nLicense\n---\nSee LICENSE file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffafeitsch%2Fsimple-timetable-routing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffafeitsch%2Fsimple-timetable-routing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffafeitsch%2Fsimple-timetable-routing/lists"}