How can i find all possible paths between two nodes ?

1 次查看(过去 30 天)
Hello everybody... when i have the nodes that shown in the code below :
Total_node = 10;
Radius = 40;
X = [10 56 15 73 20 75 45 75 15 90];
Y = [90 25 70 70 20 85 55 25 50 50];
figure; clf ;hold on;
for i = 1:Total_node
plot(X(i), Y(i),'o','markersize',20,'Color','r','linewidth',1);
text(X(i), Y(i), num2str(i));
axis([1,100,1,100]);
for j = 1:Total_node
distance_nod = sqrt((X(i) - X(j))^2 + (Y(i) - Y(j))^2);
if distance_nod <= Radius && i ~= j
connectivity_Matrix(i, j) = 1; % There is found link between node i and node j
line([X(i) X(j)], [Y(i) Y(j)], 'LineStyle', ':');
grid on;
else
connectivity_Matrix(i, j) = inf; % There is no a link
end
end
end
How can i compute all possible paths between node 1 and 10 ?
note // I do not want to use yen's algorithm because it takes a very long time when number of nodes are large . please help me ..

回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by