Ticket #444 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

[with patch, with positive review] solve the rubik's cube fast!

Reported by: was Owned by: robertwb
Priority: major Milestone: sage-2.9
Component: combinatorics Keywords:
Cc: Author(s):
Report Upstream: Reviewer(s):
Merged in: Work issues:

Description

Hi:

Two Rubik's cube programs have just been posted to  http://sage.math.washington.edu/home/wdj/rubik/ Both one is GPL's (Michael Reid's) and the other is under the MIT license (Dik Winter's). These programs have been around for some time but have never been licensed until recently (and I thank both the authors for kindly replying to my emails and agreeing to an open source license). The tarballs you will find there are identical to the author's version except that I have added a license.txt following their email directions. Now that the semester has started, I lack the time to do anything but am emailing the list in case anyone is interested and has the time to create Python wrappers for one (or both) of them. SAGE currently has a Rubik's cube solver which uses GAP and is quite slow and far from optimal. Maybe one of these could be used instead one day?

--- David Joyner

Attachments

cube-solver.hg Download (3.1 KB) - added by robertwb 3 years ago.
rubiks-doctest.patch Download (7.9 KB) - added by robertwb 3 years ago.
cubegroup-cleanup1.patch Download (4.7 KB) - added by robertwb 3 years ago.
cubegroup-cleanup2.patch Download (25.3 KB) - added by robertwb 3 years ago.

Change History

Changed 3 years ago by mabshoff

  • milestone set to sage-2.9

Changed 3 years ago by robertwb

  • owner changed from was to robertwb
  • status changed from new to assigned

Here's an spkg of solvers, needs to be tested on lots of different computers.

 http://sage.math.washington.edu/home/robertwb/spkgs/

Changed 3 years ago by robertwb

Changed 3 years ago by mhansen

  • summary changed from solve the rubik's cube fast! to [with patch] solve the rubik's cube fast!

Changed 3 years ago by mabshoff

  • milestone changed from sage-2.9 to sage-2.8.8

Is this in or not? What should we do with this patch?

Cheers,

Michael

Changed 3 years ago by was

  • milestone changed from sage-2.8.8 to sage-2.9

Changed 3 years ago by mabshoff

  • milestone changed from sage-2.9 to sage-2.8.9

Changed 3 years ago by mabshoff

  • milestone changed from sage-2.8.9 to sage-2.8.10

Changed 3 years ago by cwitty

  • summary changed from [with patch] solve the rubik's cube fast! to solve the rubik's cube fast!
  • milestone changed from sage-2.8.10 to sage-2.9

I tried the spkg and the associated patch; they worked fine (on 32-bit x86 Linux; Debian testing). However, I don't think the solvers belong as a standard spkg (adding a third of a megabyte to every Sage download); I think they should be optional. And if the spkg is optional, then the patch has some problems: it turns a working-by-default (if slow) method into a method which raises an exception when the spkg is not installed.

I think the patch should be modified to either leave the original GAP algorithm as the default, or to change the default but automatically fall back to GAP if the solvers are not installed.

Also, there should be at least one doctest for each solver.

I'm removing "[with patch]" from the summary for now; anybody who supplies a revised patch should reinstate it (or, I guess, you could reinstate it if you want to argue that the solvers should be a standard Sage package).

Changed 3 years ago by robertwb

Changed 3 years ago by robertwb

  • summary changed from solve the rubik's cube fast! to [with patch] solve the rubik's cube fast!
  • milestone changed from sage-2.9.1 to sage-2.9

In light of David Joyner's re-release of his book on Solving the Rubiks cube (using Sage) I think a fast solver is important to include even if just for marketing purposes. The GAP implementation isn't just a little bit slow, it's almost unusable (especially compared to nearly instantaneous solutions provided by the other packages).

Also I think 370K is really a quite small, 0.2% of the size of Sage itself, compared to the provided functionality.

I did, however, add doctests for the solvers.

Changed 3 years ago by robertwb

Changed 3 years ago by robertwb

Changed 3 years ago by mabshoff

  • milestone changed from sage-2.10 to sage-2.9

Changed 3 years ago by cwitty

  • summary changed from [with patch] solve the rubik's cube fast! to [with patch, with positive review] solve the rubik's cube fast!

OK, assuming the rubik solvers are to become a standard part of Sage, then this patch set looks good to me.

To install: add  http://sage.math.washington.edu/home/robertwb/spkgs/rubiks-20070912.spkg as a standard spkg, then apply all 4 attachments to this bug (one bundle, and 3 patches) in order.

Changed 3 years ago by mabshoff

  • status changed from assigned to closed
  • resolution set to fixed

Merged in 2.9.rc0.

Note: See TracTickets for help on using tickets.