Find the shortest path through a graph in efficient time, with the additional constraint that the path must contain exactly n nodes.
We have a directed, weighte
let say we want shortest distance from node x to y of k step simple dp solution would be
A[k][x][y] = min over { A[1][i][k] + A[t-1][k][y] } k varies from 0 to n-1
A[1][i][j] = r[i][j]; p[1][i][j]=j; for(t=2; t<=n; t++) for(i=0; i