A* algorithm for GetVirtualRoute function