understanding-search / maze-dataset

maze datasets for investigating OOD behavior of ML systems
14 stars 3 forks source link

add option for alternative heuristics #14

Open mivanit opened 1 year ago

mivanit commented 1 year ago

currently we use manhattan distance as the heuristic:

def heuristic(a: CoordTup, b: CoordTup) -> float:
    """return manhattan distance between two points"""
    return np.abs(a[0] - b[0]) + np.abs(a[1] - b[1])

(see maze_dataset/maze/lattice_maze.py)

This works fine for acyclic mazes, but is non-deterministic for some cyclic ones (this is particularly visible for high-p percolation mazes).

Ideally, it would be nice to be able to specify a solution heuristic in the MazeDatasetConfig. This would require modifying a number of functions to accept such a parameter: