Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

error in finding shortest path

Asked by FIR on 28 Jan 2014

I have created a graph with values

y =

   (1,3)       0.8615
   (2,3)       0.8479
   (1,5)       0.1064
   (2,5)       0.9705
   (3,5)       0.6588
   (4,5)       0.8535
   (1,6)       0.3939
   (3,6)       0.7948
   (1,7)       0.5726
   (4,7)       0.6146
   (6,7)       0.8340
   (2,8)       0.6760
   (4,8)       0.5518
   (5,8)       0.7033
   (4,9)       0.2783
   (7,9)       0.3425
   (8,9)       0.7412

bg=(biograph(y,[],'ShowArrows', 'off','ShowWeights','on'));

view(bg)

now i have found shortest path between two nodes,it works for some nodes and gives the path and distance,but for some nodes the path is empty ,for example

[dist,path,pred] = graphshortestpath(y,3,4)

the path is empty,kindly tell why i get empty path

0 Comments

FIR

Products

No products are associated with this question.

0 Answers

Contact us