Given a undirected graph $G=(V,E)$.
Imagine traversing the Graph was restricted; following an edge $a$ over a node $v$ to an edge $b$ is allowed if and only if a function $w: ( a, v, b ) \rightarrow \{0,1\}$ returns $1$.
Is there a effective solution to find the shortest path between two nodes without trying every possible path on the graph? (Since without visiting every node from every possible direction it is not guaranteed to follow every edge that might exist. Also, just remembering if a node has been already visited nor not does not fit anymore since there might be other leaving edges allowed to take - depending on the incoming edge that had been taken. )
Also, is there a more common formulation of this problem (e.g. “restricted traversal”) ?
a{x, v} and b{v, y}
sharing a nodev
and(a, v, b) = 1
then a new graph can be created in which there will be an edge{x,y}
. Now normal shortest path algo can be executed on this new graph. $\endgroup$