5313 shaares
127 private links
127 private links
This is the 4th post in a series about migrating to functional programming. This week, I'll first implement the Dijkstra algorithm, then migrate the code to a more functional-friendly design. Dijkstra's algorithm allows to find the shortest path in any graph, weighted or not, directed or not. The only requirement is that weights must be positive.