-spec get_short_path(G, V1, V2) -> Vertices | 'false' when
G :: graph(),
V1 :: vertex(),
V2 :: vertex(),
Vertices :: [vertex(),...].
get_short_path(G, V1, V2) ->
T = new(),
add_vertex(T, V1),
Q = queue:new(),
Q1 = queue_out_neighbours(V1, G, Q),
L = spath(Q1, G, V2, T),
delete(T),
L.
Vasu Dasari
Hi Bengt,The solution is to do a search starting from one of the vertices and keep track of the found paths (saving a stack of already traversed vertices and watching out for cycles), but in the worst case it is an O(n!) algorithm. Even in non-pathological cases, it is easy to get an untractable number of solutions as the complexity is exponential.