https://github.com/aggstam/london-metro
Prolog procedures to find connected stations and routes in a Metro Stations Dataset.
https://github.com/aggstam/london-metro
metro-routes prolog
Last synced: 3 months ago
JSON representation
Prolog procedures to find connected stations and routes in a Metro Stations Dataset.
- Host: GitHub
- URL: https://github.com/aggstam/london-metro
- Owner: aggstam
- License: gpl-3.0
- Created: 2023-01-24T10:01:50.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-01-31T16:52:33.000Z (over 2 years ago)
- Last Synced: 2025-01-12T20:33:34.412Z (9 months ago)
- Topics: metro-routes, prolog
- Language: Prolog
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# london-metro
Find connected stations and routes in a Metro Stations Dataset.
In this example we assume we use a basic description of London Metro.
Implementation requires *prolog* to be installed.## Execution example
```
❯ swipl -s london_metro.pl?- connected(cannon_street, monument, Line).
Line = circle ;
Line = district ;
false.?- connected(camden_town, monument, Line).
false.?- number_of_stations(N).
N = 102.?- number_of_lines(N).
N = 15.?- find_route(cannon_street, monument, Path).
Path = [cannon_street, get_line(circle), monument] .?- find_route(camden_town, monument, Path).
Path = [camden_town, get_line(northern_city), bank, get_line(subway_between_bank_and_monument), monument] .?- routes_3(List).
List = [(aldwych, angel), (aldwych, borough), (aldwych, london_bridge), (aldwych, old_street), (angel, aldwych), (angel, kensington_olympia), (borough, aldwych), (borough, kensington_olympia), (..., ...)|...].
```