# OptClock - optimal Rubik's Clock solver

Discussion in 'Software Area' started by qqwref, May 25, 2014.

Welcome to the Speedsolving.com. You are currently viewing our boards as a guest which gives you limited access to join discussions and access our other features. By joining our free community of over 30,000 people, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

1. ### qqwrefMember

7,830
30
Dec 18, 2007
a <script> tag near you
WCA:
2006GOTT01
qqwref2
OptClock is a new program to optimally solve the Rubik's Clock. It can solve any position in seconds on my machine, and it can also generate and solve thousands of random positions in a row, and then display statistics. I came up with the algorithm and wrote the original C++ program, and Ben Whitmore (ben1996123) added a GUI.

Download at mzrg.com/rubik/optclock/optclock.rar or mzrg.com/rubik/optclock/optclock.zip. There is a GUI version, two non-GUI versions with source code, and a readme file.

To run the GUI version you will need QtCore4.dll and QtGui4.dll; the other versions will run standalone. Download here.

Last edited: Jun 1, 2014
2. ### 10461394944000Banned

687
3
Mar 18, 2014
in d middle of angleland
WCA:
2009WHIT01
ben1996123
So far we've sub-optimally solved millions of scrambles and haven't been able to find a depth 12 position. The average optimal depth seems to be about 9.4.

3. ### strakerakMember

939
4
Apr 3, 2013
Houston, TX
WCA:
2013TAWA01
CubingBattles
Hooray for optimal clock solves!

4. ### qqwrefMember

7,830
30
Dec 18, 2007
a <script> tag near you
WCA:
2006GOTT01
qqwref2
Yeah, speaking of statistics, here's 100,000 optimal solves I did:
Code:
5	2
6	22
7	673
8	7898
9	40977
10	47959
11	2469
Average: 9.43579

5. ### JakubeMember

790
4
Feb 3, 2011
Austria
WCA:
2011KOGL01
JakubeBLD
Nice solver.

I programmed an optimal clock solver last summer. I'll check, If I can find it anywhere. But If I remember correctly, it was a bit slower than OptClock. I also solved a bunch of random scramble and got the same result, no position required more than 11 moves.

By the way, I can't get the gui or the stats to run. I downloaded the 4 dlls (libgcc_s_dw2-1.dll, libstdc++-6.dll, QtCore4.dll and QtGui4.dll). Now when I start the gui, ,nothing happens. And the stats crashes, after I enter the searching depth, but no error message. otpclock.exe works however.

6. ### RenslayMember

Aug 1, 2011
Hungary
WCA:
2005HANT01
Renslay
I am surprised that there is no God's number or full statistics for the number of positions for each distances for this puzzle.
Maybe this is because the high number of possible postions? How many positions there are? (I probably could calculate it, I'm just too lazy...)

723
2
May 15, 2010
WCA:
2010UTOM01
yoinneroid
12^12?

8. ### JakubeMember

790
4
Feb 3, 2011
Austria
WCA:
2011KOGL01
JakubeBLD
No, it's 12^14 = 1.28 * 10^15. There are 9+9 = 18 little clocks, and the 4 corner clocks on the front are mechanically linked with the 4 corner clocks on the back. So only 14 clocks are free. Any position of these clocks is possible.

595
1
Jul 13, 2009
Darkangel2347
According to Jaap's puzzle site for the Rubik's clock, God's number is 13.

Jaap's puzzle site describes the mathematics of this puzzle well.

10. ### JakubeMember

790
4
Feb 3, 2011
Austria
WCA:
2011KOGL01
JakubeBLD
No, it only says, that every scrambled clock can be solved in 13. So 13 is only a upper bound.

11. ### ryanj92Member

1,574
21
Dec 26, 2011
Sheffield, UK
WCA:
2012JONE03
forty3quintillion
Thanks for this, qq and Ben! Will have a look at optimal solutions at some point and see how my efficiency fares up

12. ### irontwigMember

Apr 6, 2009
Sweden
WCA:
2010JERN01
jernqvist
Well, it's barely a puzzle.

13. ### RenslayMember

Aug 1, 2011
Hungary
WCA:
2005HANT01
Renslay
Define "barely".

14. ### JakubeMember

790
4
Feb 3, 2011
Austria
WCA:
2011KOGL01
JakubeBLD
Funny "bug"?

If you want to solve the solved state optimally, it finds the basic solution instantly (0+0), but then takes 1.2 seconds to assure, that there is no shorter solution.

15. ### whaukMember

464
20
Sep 28, 2008
Germany
WCA:
2008KARL02
whauk
So the number of positions is quite high? However the number of symmetries should be very high, too. There should be 16 rotation/mirror symmetries, 2 time inversion symmetries and the 14 free clocks must take some value twice. My intuition tells me, one should be able to exploit this fact in another symmetry. (I could be wrong)

One more: Turning a wheel can be viewed as an element in the Z/12Z group. There are isomorphisms of this group to itself, that are: multiplying every element by a number, that is co-prime to 12. (1, 5, 7, 11 are the only ones I think). Having thought about that, time inversion is just multiplication by 11.

Putting all these together yields: 16*4=64. Assuming the number of symmetry-invariant positions is very small, the remaining interesting positions add up to: ~2*10^13. Did I miss some symmetries?

Also, when reducing the number of states for every single clock, can we find out some god's numbers there?

16. ### yoinneroidMember

723
2
May 15, 2010
WCA:
2010UTOM01
yoinneroid
oh yeah, somehow I forgot to count the 2 center clocks >.>

17. ### qqwrefMember

7,830
30
Dec 18, 2007
a <script> tag near you
WCA:
2006GOTT01
qqwref2
That's not really a bug, just a result of how this particular algorithm works. It will loop through the 12^8 possible phase 1 positions no matter what, although it discards all of them immediately.

Do you remember what your algorithm was to find optimal solutions?

Oh yeah, and I ran 50 million scrambles with upper bound of 11, but could not find any 12s
Code:
Batch solving complete.
Depth Positions
0: 0
1: 0
2: 0
3: 0
4: 6
5: 69
6: 1446
7: 20099
8: 190078
9: 1263622
10: 6234395
11: 42290285
12: 0
13: 0
Average depth: 10.8116
Took 21196.5s.

18. ### JakubeMember

790
4
Feb 3, 2011
Austria
WCA:
2011KOGL01
JakubeBLD
If I remember correctly, it was very straightforward. I just had a prune table for the cross.
Solved one cross with the 15 possible moves, then solved the cross + edges on the other side with the other 15 moves. And I used the fact, that moves are commutative.
My algorithm wasn't a 2-phase solver. The first solution I found, was the optimal one.

The more I thing about my solver, the more slower it gets. A few hours ago, I thought, that it solved 11 move solutions in half a minute. At the moment I think, that it took up to 5 minutes.
I will search for my code and test it. I didn't optimize it in any way. I thought about a clock solver today, and I have quite a lot of improvements and ideas. Maybe I'll improve my program in the next days.

19. ### 10461394944000Banned

687
3
Mar 18, 2014
in d middle of angleland
WCA:
2009WHIT01
ben1996123
50 million more suboptimal solves:

Code:
3: 0
4: 5
5: 86
6: 1455
7: 19884
8: 190928
9: 1262901
10: 6234657
11: 42290084
12: 0

20. ### rokickiMember

255
4
Oct 31, 2008
Can I get the README file? I'm on a Mac, so I can't run the program, and I don't have a rar unarchiver.