Jump to content
BrainDen.com - Brain Teasers
  • 0


Guest
 Share

Question

12 answers to this question

Recommended Posts

  • 0

So my goal is to do your programming homework for you?

Dude, if you'd been around this forum for a while you'd know that dude doesn't need anyone doing his homework, he's one of the top riddlers here...

What kind of school would give out homework to make an algorithm as nasty as that anyways?

Back on topic: I've been trying to crack the rubic cube since I was 10, I have about 3 or 4 laying around the house and one of them I'm using as a cupholder, once I figure out how to actually solve one myself I'll start thinking about teaching a comp to do it...

Link to comment
Share on other sites

  • 0

There are a lot of ways to do this. But the best solution is to use an

parallel distributed genetic algorithm.

. Then you don't need to know how to solve one yourself, and you don't need to worry if it is 3 X 3 X 3 or if it is a n X n X N.

Actually built the thing as homework for at my faculty :D , it was fun.

Go do your own homework :P

Link to comment
Share on other sites

  • 0

A 3x3 rubix cube can always be solved in 20 steps. There are 17 possible moves each step (18 for the first move), yielding:

17^20 = 4,064,231,406,647,572,522,401,601 possible combinations. I don't think brute force is going to cut it here.

As long as we're not concerned about execution time, you could do a semi-brute force method, re-syncing at known checkpoints (you'd have to keep the steps between checkpoints <=7 i think) you may be able to reach checkpoints.

http://www.alchemistmatt.com/cube/Denny3x3/topedges/topedges.html

breaks down solving the rubix cube down into steps that are small enough that BFM between steps is possible.

This would be the approach I would take. I'm sure there is a much more elegant (and exponentially more complicated) way of doing it

Link to comment
Share on other sites

  • 0

Use (possibly bidirectional) breadth-first search to find the shortest solution.

If you want a fast-to-find solution, code up the "fastest rubik's cube solution" on the web. Then it isn't really a search task, just following steps. Removing searching will speed it up immensely, but you won't get the shortest solution.

As for rubik's cubes, I'm not fast at all but I can solve any size. I've got a 7x7x7 vcube and it takes me an hour and a half to solve it. I use a method that combines my solutions (including parts of algorithms I looked up on the web and memorized) for the 4 and 5, but does so quite slowly. How can people solve that thing in 5 minutes....

Link to comment
Share on other sites

  • 0

I can solve a 3x3 in about 2 minutes, but there are machines that can do it for about 30 seconds(if they were as mobile as humans it will probably take them 10), but the point is that machines seem to randomly play with the cube and then tah-dah-solved while most people use formulas and you can actually see their progress.I'm not in programming' but I bet it will take some time to make a program that always works and shows it's working(step by step).

Link to comment
Share on other sites

  • 0

I need something to generate an array representing the unsolved cube. I'll be writing an interface in which you can input the "unsolved cube." It will solve it, output the number of steps, and detail each move. It's not brute force, though, and doesn't solve it in the fewest moves. It follows the pattern I know for solving a 3x3x3, checking itself after each step.

Alternatively (and as a joke), I'll write up one that simply renames one side to an appropriate color (or number) making the cube appear solved. This would be the program-equivalent of removing the stickers and placing them on their respective sides.

Link to comment
Share on other sites

  • 0

That's actually the funniest thing I've heard in awhile. It's a reference to the NES console--the button sequence for many cheats.

---

I'm taking this rubik's challenge to a new level. I'm going to write a windows batch file to scramble and solve it. It's actually not nearly as daunting as I had originally imagined.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...