Solver A* implementation
Make solver immutable