seratne / salvations-edge-verity

15 stars 18 forks source link

Added a wishlist to the swap algorithm. There was a fault in the algo… #11

Open tkluthe opened 2 weeks ago

tkluthe commented 2 weeks ago

Added a wishlist to the swap algorithm. There was a fault in the algorithm where it would get down to one swap available and made an assumption to just add what the left had received in the most recent swap back to left's swap stack. The wishlist finds each aisle's set of shapes that they do not already have which leads to the final correct solution. This has the benefit of shifting shapes towards aisle's that actually need them for the solution, and a burndown list to keep going until we know that no aisle has a wishlist item left (they have all reached their correct solution). If a swap is made and one of the aisle's did not have their received item on their wishlist it, it is immediately added back to the swap list (and should be pushed towards an aisle that wants that shape in the next iteration).

Fixes #10