using graph from polygonal-ds, genericizing the astar from polygonal/ai