first_spot_with_locations_after_actions is using a BFS to find a location to access, but there are so many accessible spots at this point that the list fills with a few million options and becomes quite slow.
It's probably better to switch to a heap that contains (ctx, used global actions, depth).
first_spot_with_locations_after_actions
is using a BFS to find a location to access, but there are so many accessible spots at this point that the list fills with a few million options and becomes quite slow.It's probably better to switch to a heap that contains
(ctx, used global actions, depth)
.