Let's say we have two directed and positive-weighted graphs on one set of vertices (first graph represents for example rail-roads and the second one - bus lanes; vertices are bus stops or rail-road stations or both). We need to find the shortest path from A to B, but we can't change the type of transport more than N times.
I was trying to modify the Dijkstra's algorithm, but it's working only on a few "not-so-mean-and-complicated" graphs and I think I need to try something different.
How to best represent that "two-graph" and how to manage the limited amount of changes in traversing the graph? Is there a possibility to adapt Dijkstra's algorithm in this one? Any ideas and clues will be helpful.
Edit: Well I forgot one thing (I think it's quite important): N = 0,1,2,...; we can come up with any graph representation we like and of course there can exist maximum 4 edges between every two nodes (1 bus lane and 1 railroad in one direction, and 1 bus lane and 1 railroad in the second direction).