IcoSoKu solver

margin-left: 30px;

Faces example

I wrote a simple javascript IcoSoKu solver. You can enter the configuration of the 12 yellow pins in the text boxes and click “Solve IcoSoKu” to calculate the solution. For example if you have the yellow pin 5 on vertex A (the top vertex), you must type 5 in the Pin A text box. The faces are identified with their three yellow pins (see a small example on the right).

The 20 white tiles are identified with their black dots; for example (2,2,0) represents the tile with two black dots in the first and second corner and zero dots on the third.If the solution says put tile (1,2,3) on face [11,12,7], then you must put the white tile on the bottom-left face, and rotate it until 1 black dot is on yellow pin 11, 2 black dots are on yellow pin 12 and 3 black dots are on yellow pin 7. You can also generate a random yellow pins configuration clicking “Random IcoSoKu”.

Pin A:

 Pin B:  Pin C:  Pin D:  Pin E:  Pin F:

 Pin G:  Pin H:  Pin I:  Pin J:  Pin K:

Pin L:

 

 



I didn’t tested the solver too much, so if you find a wrong solution or a pin configuration
that doesn’t produce a solution, please post a comment below to help me fix the bugs.

12 thoughts on “IcoSoKu solver

    • Don’t worry, I completely rewrote the layout: now vertices are marked with letters and the faces in the solution refer to pins (this should result in a more readable solution).

  1. Wonderful! I assume that your solution for any given pin arrangement is unique, but I’m not sure if solutions are in fact unique for all pin arrangements. Have you figured out any graph theory approach that would answer that question? I’d like to use this puzzle as an example of a deterministic game which students could apply basic graph analysis to solve. Easy to say, but I’m not sure yet how difficult that would be. Anyway … thanks for the solution page. Some arrangements were driving me batty!

    • > I assume that your solution for any given pin arrangement is unique

      Yes, the solver doesn’t use random values.

      > I’m not sure if solutions are in fact unique for all pin arrangements

      No, there are (I think many … perhaps all) pin arrangements that have more than one solution (using a constraint solver I found one of them just out of curiosity )

      >Have you figured out any graph theory approach that would answer that question?

      No, but I think that a complete analysis of the game would be interesting.

      >I’d like to use this puzzle as an example of a deterministic
      >game which students could apply basic graph analysis to solve
      >Easy to say, but I’m not sure yet how difficult that would be

      … you just have to try to find out 🙂 🙂
      Instead I thought of a possible generalization of the game to study its complexity … but for now I have not arrived at any maningful conclusion.

  2. The game is very interesting but mathematically difficult…
    And this solver is also a good job!
    Now let me report a bug case;
    Pin A:9
    Pin B:4 Pin C:10 Pin D:12 Pin E:7 Pin F:8
    Pin G:5 Pin H:6 Pin I:2 Pin J:1 Pin K:3
    Pin L:11
    (When I try the case, the solver freezes.)

    • Thank you for the test case; it is probably an “hard” instance and the solver takes too much time to solve it.
      But if you put the icosoku upside-down (A:11, B:5, C:6,…) it will give the correct solution quickly:

      SOLUTION OF GAME [11,5,6,2,1,3,4,10,12,7,8,9]:
      Put tile (3,3,0) on face [11,6,2], tile (3,0,0) on face [11,2,1], tile (0,1,1) on face [11,1,3], tile (2,0,1) on face [11,3,5], tile (3,1,2) on face [11,5,6], tile (0,2,2) on face [6,10,12], tile (0,2,1) on face [6,12,2], tile (1,2,3) on face [2,12,7], tile (0,0,0) on face [2,7,1], tile (0,1,2) on face [1,7,8], tile (0,0,1) on face [1,8,3], tile (1,2,0) on face [3,8,4], tile (0,0,2) on face [3,4,5], tile (1,0,2) on face [5,4,10], tile (0,2,1) on face [5,10,6], tile (3,3,3) on face [10,9,12], tile (3,2,1) on face [12,9,7], tile (2,2,2) on face [7,9,8], tile (2,1,3) on face [8,9,4], tile (1,1,1) on face [4,9,10]

      When I have enough time I’ll try to improve the algorithm adding an heuristic to solve instances like the one you’ve found.

  3. I would be very interested to know how the program achieves the solution. Is it an algorithm? Or is it perhaps that the solution for pin arrangements is based on a distortion of an already existing solution?

  4. Would you mind including a brief documentation of the this method. How did you manage to approach this problem beforehand, and what optimizations are used to reduce the time taken to solve the puzzle?

    • I didn’t analyze neither the complexity of the problem nor tried to find optimization heuristics; actually it is a simple brute force algorithm. Perhaps it would be interesting to see if the problem can be generalized to instances of arbitrary size, and then study the computational complexity of the related decision problem: “Given a partially filled IcoSoKu instance, decide if it admits a valid solution”. Let me know if you’re going to work on it.

      • I am actually doing this for my maths project this year, so I am wondering if there are really any special properties for this puzzle which enables one person to use a algorithm to solve it manually (like a rubrics cube for instance). Currently we are trying to use smaller platonic solids to attempt to find some clues, but we are not really sure yet.

  5. Bugged case? Or am I misinterpreting your output
    SOLUTION OF GAME [1,10,9,6,7,8,11,3,5,2,4,12]:
    Put tile (0,3,3) on face [1,9,6]
    Put tile (0,0,2) on face [1,6,7]
    Put tile (0,1,1) on face [1,7,8]
    Put tile (1,2,3) on face [1,8,10]
    Put tile (0,2,1) on face [1,10,9]
    Put tile (1,1,1) on face [9,3,5]
    Put tile (2,1,3) on face [9,5,6]
    Put tile (0,0,0) on face [6,5,2]
    Put tile (0,0,3) on face [6,2,7]
    Put tile (0,0,1) on face [7,2,4]
    Put tile (1,2,0) on face [7,4,8]
    Put tile (2,0,2) on face [8,4,11]
    Put tile (3,3,3) on face [8,11,10]
    Put tile (1,2,0) on face [10,11,3]
    Put tile (1,0,2) on face [10,3,9]
    Put tile (0,2,1) on face [3,12,5]
    Put tile (2,3,1) on face [5,12,2]
    Put tile (1,2,0) on face [2,12,4]
    Put tile (1,3,2) on face [4,12,11]
    Put tile (2,2,2) on face [11,12,3]

    Why are there faces 1,9,6
    How is that even possible

Leave a Reply

Your email address will not be published. Required fields are marked *