fn dijkstra(square: &Square) -> usize
Implementation of Dijkstra’s algorithm without using the decrease-key functionality.