I’m implementing a Dijkstra program in C++ and I’m having some problems, let me explain:
For the moment I’ve been following this code:
This code prints the full path from the source to all other vertexs.
I’m using an array int parent[num_vertexs]; to store the path. But the problem is that I don’t want the full path, only the FIRST vertex visited.
How can I get only the first node visited? Is there any way to print only the first node of the parent array for each node?
Thank you very much for your time.