An open API service indexing awesome lists of open source software.

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.

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), (..., ...)|...].
```