Template Function ADS::gridDistance

Function Documentation

template<class Free, class Moves = FourMoves>
int ADS::gridDistance(int rows, int cols, GridCell s, GridCell t, Free &&free, const Moves &moves = FOUR_MOVES)

gridDistance(): the distance in moves from the cell s to the cell t of the rows x cols grid through the cells x with free( x ), INF if t cannot be reached; the visit stops when t leaves the queue

Pre:

rows , cols >= 0, s and t are cells of the grid, s is free