Daniele said:
Hi there is a way to put in a struct of vectors all the possibles
routes in a graph from s to d?
Hi thought Dijkstra but I don't know how can i do.
It is possible because C++ is a language that allows recursive calls
to functions (except 'main').
Declare a vector in which you will try to build a single path. Define
a function to which you will pass the vector under construction and
your collection of vectors (the complete list of routes), and the set
of nodes to exclude. Proceed to enumerate all nodes from current one
while checking against the exclusion set. If you reach your destination
node, add the currently built path to the list and return. If you see
no way ahead (dead end), don't add the currently built path, but still
return. Shouldn't be that difficult.
To be fair to the newsgroup, your question is only marginally related
to the subject of comp.lang.c++. Perhaps you should make an attempt to
code what you think the right algorithm is, and if you encounter any
_language_ problem, come back and post a particular _language_ question.
Victor