faire en utilisant l'algorithme de Dijkstra en matlab?

11 views (last 30 days)
je voulais que vous m'aider j'ai 4 (A,B,C,D,E)nodes de A,B=5,A,C=2;B,C=1;C,D=1;B,E=7;D,E=6;.comment faire en utilisant l'algorithme de Dijkstra en matlab pour avoir le chemin le plus court si vous pouvez me donner le programme de faire ça merci bcq !
  1 Comment
Ashish Uthama
Ashish Uthama on 22 Feb 2011
translation:
http://translate.google.com/translate?js=n&prev=_t&hl=en&ie=UTF-8&layout=2&eotf=1&sl=auto&tl=en&u=http%3A%2F%2Fwww.mathworks.com%2Fmatlabcentral%2Fanswers%2F1703-je-voulais-que-vous-m-aider-j-ai-4-a-b-c-d-e-nodes-de-a-b-5-a-c-2-b-c-1-c-d-1-b-e-7-d-e-6-comment

Sign in to comment.

Answers (2)

Oliver Woodford
Oliver Woodford on 21 Feb 2011
Cherchez Dijkstra au "File Exchange".

Maissa Magri El ouadjeri
Maissa Magri El ouadjeri on 9 Dec 2021
clc;
s=[1 1 1 2 3 3 3 4 4 5 5 6 6 6 7 7 7 8 8 9 9 10 10 11];
t=[2 3 4 5 5 7 13 7 8 6 12 10 12 13 8 10 13 9 10 10 12 11 13 12];
weights=[3 5 4 1 3 7 6 4 2 5 10 3 2 1 1 3 1 2 5 6 7 1 1 1];
G=graph(s,t,weights)
G =
graph with properties: Edges: [24×2 table] Nodes: [13×0 table]
plot(G,'EdgeLabel',G.Edges.Weight)
s1=[1 2 5];
t1=[2 5 10 ];
weights1=[3,1,10];
hold on
L=graph(s1,t1,weights1)
L =
graph with properties: Edges: [3×2 table] Nodes: [10×0 table]
plot(L,'r',L.Edges.Weight,)
Error using graph/plot>checkinputnames (line 151)
Trailing input arguments must occur in name-value pairs.

Error in graph/plot (line 86)
[args, is3D, useData, needAutoColor] = checkinputnames(args,nameOffset);

Community Treasure Hunt

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

Start Hunting!