We have extended the basic algorithm of d'Esopo to allow cost functions at a point to depend on more nodes than just a single node and its immediate neighbours. The information made available to the cost function includes static details about the whole path, such as the locations of the start and end points and any intermediate points that have been indicated by the user.
There is also dynamic information about the node currently being considered and previous nodes along the best path found so far. This facilitates the inclusion of more complex cost functions depending on, for example, the curvature of the path. A pseudo code representation for the extended d'Esopo algorithm is shown in Figure 1.
For the specific problem of finding minimum cost paths in images, some decisions have to be made about network representation. The image is represented as a grid of points, each with a particular intensity. Each network node corresponds to a point (pixel) in the image and has up to eight neighbours which correspond to the adjacent points in the image.
The network itself is also represented as a grid. The links between nodes are not stored explicitly but are implicit in the locations of nodes within the grid. Each node keeps a record of the total cost of the best path to the node, the length of the best path and the direction to the previous point on the path. In addition, flags indicate if the node has been on the queue, if it is currently on the queue and if it is an intermediate path point selected by the user.
The cost of moving between nodes is computed as the algorithm proceeds and is some function of the point intensities and locations within the image. The cost function is implemented separately from the main algorithm so that different cost functions may be used. The user can also supply arbitrary information to the cost function, for example, weighting parameters for the cost calculation.
This design allows a wide variety of cost functions to be implemented, including costs that depend on the intensities of the start and end points and costs that vary with the local curvature of the path.