Anonymous user
Dijkstra's algorithm: Difference between revisions
→{{header|Mathematica}}
No edit summary |
|||
Line 1,516:
This solution is incorrect. Since the path is directed and f is only a sink, f cannot be in the middle of a path.
<lang Mathematica>bd = Graph[
"a" \[
"e" \[DirectedEdge] "f"},
EdgeWeight -> {7, 9, 10, 15, 11, 6, 14, 2, 9},
VertexLabels -> "Name", VertexLabelStyle -> Directive[Black, 20],
ImagePadding -> 20]
FindShortestPath[bd, "a", "e", Method -> "Dijkstra"]
-> {"a", "c", "
[[File:
=={{header|Maxima}}==
|