Computer scienceAlgorithms and Data StructuresAlgorithmsGraph algorithmsShortest path algorithms

Lee's algorithm

Reconstructing the algorithm

Report a typo

Sort the list below in the order that reconstructs the Lee algorithm.

Put the items in the correct order
Initialize a variable ii with the label of the target point.
Consider all unlabeled neighbours of points with label ii and set their labels to i+1i+1.
Repeat two previous steps until the target point is reached.
Consider all neighbours of the current point and move to any with label i1i-1.
Initialize a variable ii with 00.
Set ii to i+1i + 1.
Repeat two previous steps until the start point is reached.
Label the start point with 00.
Set ii to i1i-1.
___

Create a free account to access the full topic