Solving Geek Problems

terça-feira, julho 27, 2004

Mind blowing Puzzle Game!

The other day I was having a drink in the usual café and realized that the owner had put some mind games for the customers to experiment. Games such as the classic Rubik’s Cube and other puzzle games.

Most of the games were quite easy to solve, usually taking about 5 minutes. There was one though that blew my mind away. I spent more than 40 minutes trying out different approaches and none of them seem to get me anywhere else than frustration.

The game consisted in 13 pieces, that look like Tetris pieces, that one had to combine in order to and fit them inside a small squared board (8x8 individual positions).

Since I wasn’t going anywhere with the manual approach I thought:
- I’ll outsmart you, you little bastard, I make a program to solve you! And so, I copied the pieces onto a paper napkin and left home to program the solution (at 2 AM).

First I thought, this is a typical genetic algorithm (GA) kind of problem but I had no good GA libraries at hand, so I decided to do a full combinational approach, brute force that is. Trying all the possible combinations of all the pieces in all positions, in all possible rotations, and mirrored, adding up 13*4*2*8*8 = 6656 distinct pieces.

How wrong was I! The software takes roughly millions of years to compute all the solutions. We’re talking about 13^6656 possible combinations. It’s just too much, so I begun optimizing. I started by removing the pieces that were repeated due to equivalent rotations or mirroring, reducing the number of pieces to 2285. Then I created some methods to evaluate the viability of reaching a solution right after inserting each piece. This means that after inserting a piece on the board the algorithm tests if there are any holes on the board that will never be filled because they’re too small to fit any left over piece this way eliminating unnecessary tests.

Even so, the algorithm takes too much time to calculate a single solution (I’m interested in getting all the possible solutions). I can’t predict how much time it will take, since the combination cutting routine makes it very hard to compute how many interactions I have eliminated.

What I want from you is some suggestions on how to reach a solution in useful time (let’s say 24 hours). I'm sure it would be possible. We have reached the moon for god sake!

All the 13 puzzle pieces:







Due to lack of time I still havent finished the programs. The algorithms I have implemented are almost done, but some tiny bug is stopping the algorithms to reach a solution. Feel free to experiment. A graphical board
with animation is included.


Good luck.

Cheers.

13 Comments:

  • Hi i bumped into a puzzle very similar with yours (if i understood correctly) only that in my case the final output should have been a 3x3x3 cube. I was so excited by it that i couldn't stop myself to create a genetic algorithm to solve it, and i actually succeeded. In about 10 seconds it gave me the correct answer. The steps i fallowed to solve it are posted here (http://alifetolearn.blogspot.com/2008/03/learning-to-solve-puzzles-with-genetic.html).
    Maybe you can check it out.

    By Anonymous Anónimo, at 18 de abril de 2008 às 15:26  

  • Hi !.
    might , probably very interested to know how one can make real money .
    There is no need to invest much at first. You may commense earning with as small sum of money as 20-100 dollars.

    AimTrust is what you haven`t ever dreamt of such a chance to become rich
    The firm represents an offshore structure with advanced asset management technologies in production and delivery of pipes for oil and gas.

    Its head office is in Panama with offices everywhere: In USA, Canada, Cyprus.
    Do you want to become an affluent person?
    That`s your chance That`s what you wish in the long run!

    I`m happy and lucky, I began to take up income with the help of this company,
    and I invite you to do the same. If it gets down to select a correct partner who uses your savings in a right way - that`s AimTrust!.
    I take now up to 2G every day, and my first investment was 500 dollars only!
    It`s easy to join , just click this link http://jimiredycy.uvoweb.net/irywywe.html
    and go! Let`s take our chance together to feel the smell of real money

    By Anonymous Anónimo, at 1 de dezembro de 2009 às 16:20  

  • Hello !.
    You re, I guess , probably very interested to know how one can make real money .
    There is no need to invest much at first. You may begin to get income with as small sum of money as 20-100 dollars.

    AimTrust is what you need
    AimTrust represents an offshore structure with advanced asset management technologies in production and delivery of pipes for oil and gas.

    It is based in Panama with structures everywhere: In USA, Canada, Cyprus.
    Do you want to become really rich in short time?
    That`s your choice That`s what you really need!

    I`m happy and lucky, I began to take up real money with the help of this company,
    and I invite you to do the same. If it gets down to choose a correct partner who uses your savings in a right way - that`s the AimTrust!.
    I earn US$2,000 per day, and what I started with was a funny sum of 500 bucks!
    It`s easy to get involved , just click this link http://tiqaniga.easyfreehosting.com/azyfyryb.html
    and go! Let`s take our chance together to feel the smell of real money

    By Anonymous Anónimo, at 6 de dezembro de 2009 às 23:33  

  • Good day !.
    You may , probably curious to know how one can collect a huge starting capital .
    There is no initial capital needed You may begin to receive yields with as small sum of money as 20-100 dollars.

    AimTrust is what you thought of all the time
    The company incorporates an offshore structure with advanced asset management technologies in production and delivery of pipes for oil and gas.

    It is based in Panama with affiliates everywhere: In USA, Canada, Cyprus.
    Do you want to become really rich in short time?
    That`s your chance That`s what you wish in the long run!

    I feel good, I started to take up real money with the help of this company,
    and I invite you to do the same. If it gets down to choose a correct companion utilizes your funds in a right way - that`s AimTrust!.
    I earn US$2,000 per day, and my first investment was 500 dollars only!
    It`s easy to start , just click this link http://ifonebuk.kogaryu.com/gapalo.html
    and lucky you`re! Let`s take our chance together to feel the smell of real money

    By Anonymous Anónimo, at 11 de dezembro de 2009 às 15:11  

  • Hello !.
    You may , probably curious to know how one can collect a huge starting capital .
    There is no initial capital needed You may start to receive yields with as small sum of money as 20-100 dollars.

    AimTrust is what you thought of all the time
    AimTrust incorporates an offshore structure with advanced asset management technologies in production and delivery of pipes for oil and gas.

    It is based in Panama with structures everywhere: In USA, Canada, Cyprus.
    Do you want to become an affluent person?
    That`s your choice That`s what you desire!

    I feel good, I started to take up income with the help of this company,
    and I invite you to do the same. If it gets down to choose a correct partner utilizes your funds in a right way - that`s AimTrust!.
    I take now up to 2G every day, and my first investment was 500 dollars only!
    It`s easy to start , just click this link http://ofopyhik.greatnow.com/itumik.html
    and lucky you`re! Let`s take our chance together to become rich

    By Anonymous Anónimo, at 14 de dezembro de 2009 às 08:47  

  • Hi there!
    I would like to burn a theme at this forum. There is such a nicey, called HYIP, or High Yield Investment Program. It reminds of ponzy-like structure, but in rare cases one may happen to meet a company that really pays up to 2% daily not on invested money, but from real profits.

    For quite a long time, I make money with the help of these programs.
    I don't have problems with money now, but there are heights that must be conquered . I make 2G daily, and my first investment was 500 dollars only.
    Right now, I'm very close at catching at last a guaranteed variant to make a sharp rise . Visit my web site to get additional info.

    [url=http://theblogmoney.com] Online investment blog[/url]

    By Anonymous Anónimo, at 11 de janeiro de 2010 às 10:54  

  • Hi there!
    I would like to burn a theme at here. There is such a nicey, called HYIP, or High Yield Investment Program. It reminds of financial piramyde, but in rare cases one may happen to meet a company that really pays up to 2% daily not on invested money, but from real profits.

    For quite a long time, I make money with the help of these programs.
    I don't have problems with money now, but there are heights that must be conquered . I get now up to 2G a day , and I started with funny 500 bucks.
    Right now, I managed to catch a guaranteed variant to make a sharp rise . Visit my blog to get additional info.

    [url=http://theinvestblog.com] Online investment blog[/url]

    By Anonymous Anónimo, at 14 de janeiro de 2010 às 14:50  

  • [url=http://www.kfarbair.com][img]http://www.kfarbair.com/_images/logo.png[/img][/url]

    מלון [url=http://www.kfarbair.com]כפר בעיר[/url] - שלווה, [url=http://www.kfarbair.com/about.html]חדרים[/url] מרווחים, אינטימיות, [url=http://kfarbair.com/services.html]שקט[/url] . אנחנו מספקים שירותי אירוח מיוחדים כמו כן ישנו במקום שירות חדרים הכולל [url=http://www.kfarbair.com/eng/index.html]אחרוחות רומנטיות[/url] במחירים מיוחדים אשר מוגשות ישירות לחדרכם!

    לפרטים נא לפנות לאתר האינטרנט שלנו - [url=http://kfarbair.com]כפר בעיר[/url] [url=http://www.kfarbair.com/contact.html][img]http://www.kfarbair.com/_images/apixel.gif[/img][/url]

    By Anonymous Anónimo, at 22 de janeiro de 2010 às 14:09  

  • Good day, sun shines!
    There have were times of troubles when I felt unhappy missing knowledge about opportunities of getting high yields on investments. I was a dump and downright pessimistic person.
    I have never thought that there weren't any need in large starting capital.
    Now, I feel good, I begin to get real money.
    It gets down to choose a correct partner who utilizes your funds in a right way - that is incorporate it in real business, parts and divides the income with me.

    You can ask, if there are such firms? I have to tell the truth, YES, there are. Please get to know about one of them:
    http://theinvestblog.com [url=http://theinvestblog.com]Online Investment Blog[/url]

    By Anonymous Anónimo, at 26 de janeiro de 2010 às 20:14  

  • [B]NZBsRus.com[/B]
    No More Sluggish Downloads Using NZB Downloads You Can Swiftly Search High Quality Movies, PC Games, MP3 Singles, Applications and Download Them at Fast Rates

    [URL=http://www.nzbsrus.com][B]NZB Search[/B][/URL]

    By Anonymous Anónimo, at 7 de fevereiro de 2010 às 01:16  

  • Glad to materialize here. Good day or night everybody!

    For sure you didn’t here about me yet,
    my parents call me Nikolas.
    Generally I’m a venturesome analyst. recently I take a great interest in online-casino and poker.
    Not long time ago I started my own blog, where I describe my virtual adventures.
    Probably, it will be interesting for you to utilize special software facilitating winnings .
    Please visit my blog. http://allbestcasino.com I’ll be interested on your opinion..

    By Anonymous Anónimo, at 16 de março de 2010 às 11:40  

  • You could easily be making money online in the undercover world of [URL=http://www.www.blackhatmoneymaker.com]blackhat traffic[/URL], It's not a big surprise if you haven’t heard of it before. Blackhat marketing uses not-so-popular or little-understood ways to produce an income online.

    By Anonymous Anónimo, at 23 de março de 2010 às 00:46  

  • top [url=http://www.c-online-casino.co.uk/]uk casino[/url] check the latest [url=http://www.realcazinoz.com/]free casino[/url] autonomous no deposit hand-out at the leading [url=http://www.baywatchcasino.com/]casino games
    [/url].

    By Anonymous Anónimo, at 7 de fevereiro de 2013 às 23:10  

Enviar um comentário

<< Home