Astar optimalization