Implementation of one of Dijkstra's self-stabilizing algorithms