On Dec 13, 1:47 pm, ImageAnalyst <imageanal...@mailinator.com> wrote:
> Steve Eddins currently is doing a whole series on path finding,
> including finding all reasonable paths and ways to whittle it down to
> one path.http://blogs.mathworks.com/steve/2011/12/13/exploringshortestpaths...
>
> Not sure if you have a 2D array or image, but ..... Note: all possible
> paths for an image or NDimensional matrix, instead of a directed
> graph/network, would essentially be infinite because you could always
> keep scribbling over the image for miles and miles, but as long as you
> end at the destination, it's still a path, and there is a virtually
> infinite number of ways you could scribble over an image. But there
> are several ways to get "shortest" paths (there will be more than one
> if you think about it) of the same length.
Hi
Thank you for the reply.
I have an undirected graph and i want to find all possible shortest
paths. The only point is that i am using Yen's Kshortest paths
algorithm but don't want to limit it to "K" number of paths, rather i
need to know all possible shortest paths.
The graph looks like this:
N1 =[1 1 2 2 2 3 3 3 4 5 6];
N2 =[2 4 3 5 6 6 5 7 5 6 7];
W = [10 10 10 10 5 20 15 20 10 20 10];
netCostMatrix(1:length(N1),1:length(N1)) = inf;
for i = 1 : length(N1)
netCostMatrix(N1(i),N2(i)) = W(i);
netCostMatrix(N2(i),N1(i)) = W(i);
end
When Yen's algorithm is called, we need to specify parameters in
following way:
kShortestPath(netCostMatrix, source, destination, k_paths)
Where netCostMatrix is the graph, source and destination are source
and destination nodes respectively, we have to specify all of them.
The only thing i don't want to fix is the parameter "k_paths", program
should keep on executing until it finds all possible shortest
paths(even if they are 10 in number, i.e k goes upto 10).
Thank you once again for the help.
Best Regards
