Dijkstra's algorithm: Difference between revisions
→{{header|CafeOBJ}}
Line 1,476:
=={{header|CafeOBJ}}==
Dijkstra's algorithm repeatedly chooses the nearest vertex and relaxes the edges leaving it, terminating when no more vertices are accessible from the origin.▼
<lang CafeOBJ>
"
This code works with CafeOBJ 1.5.5(PigNose0.99).
Save this file as DijkstraRosetta.cafe.
To run the file type
Line 1,489 ⟶ 1,492:
Hence the user written list module.
▲Dijkstra's algorithm repeatedly chooses the nearest vertex and relaxes the edges leaving it, terminating when no more vertices are accessible from the origin.
Input
Line 1,507 ⟶ 1,509:
set step off
set print fancy
set stats
set verbose off
set quiet on
|