# Algorithm to find s-t min paths in a weighted graph

Given a directed graph with $n$ vertices with non-negative edge weights, I would like to find first $n^2$, $s$-$t$ minpaths with minimum sum of non-negative weights. By using Dijkstras shortest path algorithm I found out the first minpath. In order to get next minpath I have replaced edges in first minpath with infinity. By following this procedure I am missing out many minpaths whose sum of weights are much smaller than what I am getting by following above procedure.

Can some one suggest me a good procedure to list first $n^2$ minpaths.

Thank you.

• – Tyson Williams May 3 '14 at 8:47
• One way is to remove edges from every possible suffix of shortest path and finding other paths. Doing same for all possible cases. This is not an efficient way but it's a start point. Just consider that all possible suffixes of such paths are polynomialy bounded by graph size. – Saeed May 3 '14 at 11:44
• I think this has been answered (multiple times) on Computer Science. – Raphael May 4 '14 at 9:16