Dijkstra's algorithm: Difference between revisions

Content added Content deleted
Line 897: Line 897:


=={{header|Mathematica}}==
=={{header|Mathematica}}==
This is beautiful, but incorrect.
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[ {
<lang Mathematica>bd = Graph[ {
"a"\[UndirectedEdge] "b", "a"\[UndirectedEdge] "c", "b"\[UndirectedEdge] "c",
"a"\[UndirectedEdge] "b", "a"\[UndirectedEdge] "c", "b"\[UndirectedEdge] "c",