michaelhodel / arc-dsl

Domain Specific Language for the Abstraction and Reasoning Corpus
MIT License
184 stars 38 forks source link

Fix solve_6a1e5592 #13

Closed AmziJeffs closed 6 days ago

AmziJeffs commented 1 week ago

This solver fails to align one of the blocks in the second training example, as pictured below:

Expected result: expected

Solver's result: actual

I believe the issue is as follows. The solver uses a scoring function to find the best alignment for each block, which I believe is calculated as: 10 x (intersection with whole canvas) - 10 x (intersection with red tiles) - 8 x (negative space in block's rect that isn't covered by red tiles) - 8 x (distance from tile to top of canvas) - (number of tiles in outbox that are not red). Both the expected and actual results get the same score of 17.

This can be solved by changing the weights in the scoring function. I replaced EIGHT with FIVE and this seemed to fix the issue without changing any other solutions; the score for the correct arrangement becomes 20 while the incorrect arrangement still gets a score of 17.