I want to restore the path from the top of the source to the address in this graph problem.
How can I save the path and how to get it after I find the minimum cost from s to d?
Please help me find a simple answer?
For example, at the point
adjmat[i][j] = Math.min(adjMat[i][j],adjMat[i][k]+adjMat[k][j]);
I need to add a path, and I need to restore it.
source
share