I'm editing Floyd's algorithm so instead of each Dk where k is the highest intermediate vertex, k is the max path length. Eventually it will have the same output as Floyd's, but every subiteration could be different. For instance, if there are 4 vertices: 0,1,2,3, I want to find the cheapest path from 0 to 3 that has a max length of K. The graph is assumed directed.
So if k=2, then I could only check 0->3...0->1->3...0->2->3 where every arrow indicates an edge/path. If k=3, then I could only check 0->3...0->1->3...0->1->2->3...0->2->3...0->2->1->3, etc...
0 1 2 3
0 0 4 9 12
1 9 0 3 11 // the adj matrix I'm referencing for 1 example
2 9 10 0 2
3 1 99 6 0
I need help understanding the implementation in this and am not sure where to start, aside from Floyd's algorithm.