Decoding the algorithm of an existing IcoSoku solver and attempting to simplify it
Through analysis of the JavaScript, we found that the algorithm utilised the backtracking method, with an additional check to cut off any subtrees.
The code also had a function of taking the average of the values of the 3 pins surrounding any triangular face. It sorted these values in ascending order. The code also sorted the triangular pieces from few to many dots at their edges. The pieces with fewer dots will then be placed at faces with lower pin averages. This method sees a higher chance of the correct pieces being placed at the correct places in fewer attempts.
The code also had a function of taking the average of the values of the 3 pins surrounding any triangular face. It sorted these values in ascending order. The code also sorted the triangular pieces from few to many dots at their edges. The pieces with fewer dots will then be placed at faces with lower pin averages. This method sees a higher chance of the correct pieces being placed at the correct places in fewer attempts.