Dijkstra based ai