A Star Search
One feature could be implemented to speed up the computation:
In function search(...) at line 20, every time the cycle is executed, after the first time, you'll get states (nodes) that have already been discovered (inside state_cost variable), so what could be done is just to create a function that from the generated_sets (the global list of all possible sets) just filter sets which states (nodes) aren't part of the local state discovered at the previous cycle.
A Star Search One feature could be implemented to speed up the computation:
search(...)
at line 20, every time the cycle is executed, after the first time, you'll get states (nodes) that have already been discovered (inside state_cost variable), so what could be done is just to create a function that from the generated_sets (the global list of all possible sets) just filter sets which states (nodes) aren't part of the local state discovered at the previous cycle.All the rest works great!! Keep up the good work!