Here is my script. I want to implement A * (in Python) without resorting to minimal time or in operations. I need a bunch to be able to effectively get the lowest weight.
My immediate answer was “Easy! I will use heapq!” Then I found that life is less often as simple as we would like. It turns out that this strategy is suboptimal for one of the critical points A *. When I consider children, I need to periodically update dozens of children already on the heap.
For those whose A * memory is a bit lost, the bottom line is that I want to take the item, change its weight and change the heap to reflect the change, all in sublinear time.
Any suggestions?
source
share