Reputation: 1
I've been tasked with writing an algorithm in Python that is able to establish the shortest journey on a metro train system. The train network has multiple train "lines", which consist of different stations. Some stations are featured on multiple different lines. It essentially works exactly the same as the London tube network. I've been given the stations and the lines, as well as the time between each station, which will act as the cost in the algorithm. Could someone give me a brief idea of how I should approach this? Thanks.
I'm aware Dijkstra's would be the best algorithm to use for this, I'm just having trouble wrapping my head around how to actually approach it.
Upvotes: 0
Views: 189