Slashdot Mirror


Using Minesweeper to Solve NP

Blue Leader writes "Boston.com is reporting that the answer to one of math's most vexing problems lies in Minesweeper. Figure it out, and render modern encryption useless." Its a discussion of NP/P, as well as an excuse to play minesweeper. Personally, I kinda prefer mahjongg or tetris tho ;)

217 comments

  1. Re:How factoring is not NP complete but O(n^0.5) by John+Allsup · · Score: 1
    NP means that a solution to a problem can be checked in polynomial time, making it possible to bruteforce the solution.
    Barely -- the number of cases to check goes up as an exponential of the size of the problem (else the problem would surely be in P).
    NP complete means that there is no deterministic algorithm to find such solution in polynomial time.
    No --- if a problem X is NP complete, then X is in P only if every other NP problem is also in P. If P=NP then every NP-complete problem would have a deterministic algorithm to find a solution in polynomial time.
    Factoring numbers is approximately O(n^0.5) divides; simply divide the number n that you want to factor by all primes less than or equal to sqrt(n).
    But n represents the length of the input. If we work with base 2 then there are sqrt(2^n)=2^(n/2) divisors to check, working in base 10 there are sqrt(10^n)=10^(n/2) divisors. i.e. factoring the brute force way is O((2^n)^0.5) not O(n^0.5) and thus is not a polynomial time algorithm.
    John
    --
    John_Chalisque
  2. Re:It is possible... by jayhawk88 · · Score: 3

    I find it very hard to believe that Minesweeper could be won every time, at least on the Expert level, or similar "big" boards. Mostly I think this because it can be really unpredictable.

    Consider: Minesweeper (at least the Windows version) seems to give you the first "click" free. In all my playing, I've never hit a bomb on the first click. Presumably the bomb locations are randomly located after this first click.

    Now, sometimes on that first click, you get a "2" or "3", with no other spaces uncovered. What then? It comes down to luck, basically. You have no way of knowing for sure which of the 8 squares surrounding your numbers has mines, so you just have to click one and hope. Alternatively, you could click on a totally different area of the board. The odds of you not hitting a bomb are probably better if you do this, but in my experience you end up hitting a bomb enough times to make "winning almost every time" impossible.

    Even throughout a game, you usually cannot avoid coming to these "decision points", where you are unable to logically deduce the locations of bombs, and are forced to make a blind pick.

  3. Solving Minesweeper does NOT break RSA by xyzzy · · Score: 5

    It's worth pointing out that the Boston.com does gloss over some fairly important mathematics.

    All that Kaye has done is show that Minesweeper is NP complete. He has not yet found a polynomial-time solution to it, which is necessary to prove that P=NP -- in a nutshell, he just shows that Minesweeper falls into an equivalence class that holds a hell of a lot of other algorithms.

    And EVEN IF HE FINDS the polynomial solution to Minesweeper, that STILL doesn't say anything about RSA (or any other "hard" algorithm), other than that it can be solved in polynomial time SOMEHOW.

    The only reason people focus on this conjecture is they hope that proving P=NP and solving some algorithm will give them some magic insight into speeding up some other algorithm that's equivalently hard, rather than working on the algorithm directly. Or, disproving P=NP once and for all, and ensuring the computational assumptions that make people pick algorithms like RSA.

    1. Re:Solving Minesweeper does NOT break RSA by Grey · · Score: 2
      And EVEN IF HE FINDS the polynomial solution to Minesweeper, that STILL doesn't say anything about RSA (or any other "hard" algorithm), other than that it can be solved in polynomial time SOMEHOW.

      Correction, The finding of a polytime algortim for ANY NP-complete problem will give a polytime algorithem for any problem in NP. How big a polinomial is up for grabs. Factoring (which is is what one needs to break RSA) is in NP I've never worked out what the polynmial is, but likely its like say n^3 (turning machines are slow). That is to recover say one bit of a factor, (maybe more). Then you have to sya runit into say SAT give as formula that's approximatly n^6 long, then say run your sat very fast sat program(n^2) giving you a running time fo n^12 for one bit, now repeat for many bits say 1/2 n approximatly give a alogrithm with a running time of n^13 which is slow but still polynomial. Thus goverment, and other determend people will be able to break your RSA key fairly quitly. (i.e. in a few months as opposed to years or the heat death of the universe.)

      Now suppose someone make a more effiece various of the algorithm with some understanding.....

      --
      Grey (Chris Lusena)
    2. Re:Solving Minesweeper does NOT break RSA by (void*) · · Score: 2
      You are right, but the original poster is also right.

      You see, even if you could solve all the Minesweeper problems (which I seriously doubt you can without guessing), it is not the same as the Minesweeper Consistency problem.

      This is a math question folks. So the math geeks all should be careful, just like the original article should have but did not, by giving a false impression that solving minesweeper is solving P=NP.

      There is nothing new here folks. We just found a new NP Complete problem. How does that help us towards the P=NP puzzle? Nothing!

    3. Re:Solving Minesweeper does NOT break RSA by aggressivepedestrian · · Score: 1

      What if you found the polynomial solution to Minesweeper and it did give you insight into RSA? Would you take the million? Or would you try to make even more money off an RSA solution?

    4. Re:Solving Minesweeper does NOT break RSA by Harlequeen · · Score: 1

      But surely you'd release the solution as Open source? Wouldn't you?

  4. Minesweeper champion by Norge · · Score: 1

    I've been trying to find out if I am the fastest Minesweeper player in the world (a dubious honor at best). My best time on Expert level is 84 seconds. Obviously I can't prove that since no one was there, but can anyone report a lower time?

    Ben

  5. Re:Minesweeper is not free by Psi-kick+Guy · · Score: 1

    FREE WITH the operating system.

    So yes it is free.


    Just like the prizes in the cereal box is free, right?

    It's not really free, you're paying for it by buying the product that it's bundled with.

  6. Re:Birds on a wire by Venebulon · · Score: 1

    Not sure if you are just a troll or what, but, have you ever heard of a LINKED LIST?

    --
    Why is the universe here? -Well, where else would it be?
  7. That was my thought exactly! by buckrogers · · Score: 1

    Great minds and all that.

    If you reduce the minesweep board to a single pair of squares that has a single mine in one or the other then the game would be won or loss with a single click...

    This is the equivilant of flipping a coin.

    So esentially the article is saying that if you can guess correctly heads or tail with every flip of any coin that you would win $1,000,000.

    I am thinking that if you could guess that well that you could win significantly more than that amount of money.

    --
    -- Never make a general statement.
    1. Re:That was my thought exactly! by jovlinger · · Score: 2

      No.

      You'll notice that they speak about board "consistency". Basically, give me a board with a bunch of numbers on it and all other cells marked X. I'll tell you whether there exists a layout of mines (in the Xs, of course) so that your numbers are correct. This proof basically states that the best we can do is to enumerate all possible layouts and check them in turn.

      say there are n Xs on the board. If you can come up with an algorithm that runs in O(n^k) time (k some finite integer) or prove that it is impossible to do faster than O(k^n) then you win a million dollars.

      They're not asking you to play the game. mutter mutter. Reading comprehension. mutter mutter.

    2. Re:That was my thought exactly! by Werail · · Score: 1

      Ever wondered why you never hit a mine on the first click in minesweeper? The board is generated when you click the first square, and thus, with your implementation, you'd always win.

    3. Re:That was my thought exactly! by buckrogers · · Score: 1

      No, I have hit mines on the first click before.

      --
      -- Never make a general statement.
  8. Re:Important mathmatical caveat by kfg · · Score: 1

    Some of our students are very bright, but let's not always see the same hands.

  9. Heres a link which is more technical... by Anonymous Coward · · Score: 2

    ..but still understandable to most.
    http://www.claymath.org/prize_problems/million-d ollar-minesweeper.htm

  10. Re:Important mathmatical caveat by bigox · · Score: 1
    Please don't confuse NP with NP-complete. You are describing NP-complete problems. Plus, the reductions are in polynomial time and log space.

    Why is this such a big deal anyway? I'd bet that the only new thing coming out of this is another approximation algorithm, which is nothing new.

    Does anyone know the proof or reduction to the venerable 3-SAT for Minesweeper?

  11. Unclear, please help me. by Captain_Frisk · · Score: 1

    I'm new to this P / NP thing, so please don't flame me too bad if I'm a complete retard.

    Can you give me another example of a problem that is NP? Factoring a number is definetly a P problem. The algorithm for factoring a number into two pieces is easily done in less than N^(1/2) steps. Doesn't this make it by definition a P solution?

    Can someone explain this to me on a slightly lower level?

    Thanks,
    Captain_Frisk

    1. Re:Unclear, please help me. by Mark+J+Tilford · · Score: 1

      The number N is defined as the size of the information, so factoring by trial division takes at most 10^(N/2), if you're using decimal notation.
      -----------

      --
      -----------
      100% pure freak
    2. Re:Unclear, please help me. by RandomPeon · · Score: 2

      Actually, the best known factoring algorithm is NP. For an integer of size n, e^(.5(sqrt(ln n))(sqrt(ln(ln n))))) steps are required to factor it. This is the best algorithm (Garret, Number Theory, 2000). I could not explain it for the life of me, so please do not ask.

      Here's a more easily understood NP prob - the traveling salesman. The salesman wants to visit n cities one time each. Find the shortest route.

      There are n! routes (n choices for first stop, n-1 choices for the second, .... = n(n-1)(n-2)... = n!)

      This expression, n! is greater than n^k, k is an int. This assume n is big, which is the standard assumption.

    3. Re:Unclear, please help me. by RandomPeon · · Score: 1

      Oops, I forgot to mention something:

      there's no *known* method to determine the shortest route other than compare all of the routes. So you have to calculate and compare all n! routes.

  12. Decode Minesweeper? by eastMike · · Score: 1

    So, write a program that can decode Minesweeper for any size board, and you will join the pantheon of mathematical greats, alongside Euler and Pythagoras.

    Decode it? Does that just mean solve it?

    I mean, given a minesweeper board of any size, there could be lots of potential solutions. If this is just a matter of writing a program to find a solution...i.e. unconver a square (the first one is never a mine), and go from there, looking at each surrounding square and the ones near that, etc, etc, etc...in other words, write a program to do what the player is trying to do...well...I don't think that is possible. There are probably lots of cases where such a program would work, but there have been so many times that I've, for instance, come down to a point where there are 2 squares left, 1 mine left, and EITHER ONE of them could be the mine. At that point, it's just a guess. There have been a few times where that foiled my attempt to beat my best time of 60 seconds for expert mode. Since a program cannot truly guess the correct answer every time, then this is not possible. If the program was written with knowledge of the algorithms used to place mines, or somehow actually knew where to look, well, it might be possible then, but it wouldn't be a guess then...that would be cheating.

    "It is well that war is so terrible, lest we grow too fond of it."

    --

    Time is fun when you're having flies.
    -Kermit the Frog
  13. Re:Weird by irksome · · Score: 1

    That's totally wrong. You may have just gotten lucky with your first picks. I find that about 20% of the time, my first click will find a mine, and end the game right there.

    -

  14. Re:It is possible... by wljones · · Score: 1

    My own time is more like 250 seconds, but my conclusions are the same. There will be no bomb found on the initial move with M$ and some other versions. Only a very few games can be solved with pure logic. It helps if the initial move uncovers a sizeable space with several bombs clearly indicated. Midgame may force one or more guesses, and end game may force a 50 percent, or less probable guess, on four or more spaces.

    On the bright side, a cheat of the "easter egg" type does exist. I did not copy or remember it, and forgot the URL in a few minutes.

  15. Re:fun with minesweeper by Sloppy · · Score: 1

    Since the program could definitively tell whether or not a move was safe, it could detect when a player was *GUESSING*. And so we could hack the program to always reveal a mine in such cases, driving the game weenies insane. :-)

    *gasp*

    You ... you .. you BASTARD!

    ;-)


    ---
    --
    As copyright owner of this comment, I authorize everyone to defeat any technological measure which limits access to it.
  16. Re:render encryption useless? by bigox · · Score: 1
    So you are right, a proof that P=NP doesn't necessarily tell you how to solve any NP-complete problems in polynomial time

    Actually you can from the get go. NP-complete is closed under transitivity, so if you find a P solution of an NP-complete problem, you are pretty much done since the composition of two polynomial time reductions is itself polynomial! So, the proof of P=NP could definitely provide a direct solution, just compose the sequence of known reductions.

  17. Unfortuantely, I can't.... by xonix7 · · Score: 1

    Since I only have a Master of Technology qualification, and the United States doesn't recognize it, apparently (maybe I'm wrong, I don't know...)

    --
    Everything is but a number spoken by itself.
  18. Re:What if your first guess is a mine? by Chris+Mattern · · Score: 1

    Hence the easiest way to ensure you always win:
    100-square board, 99 mines.

    Chris Mattern

  19. I always thought that minesweeper... by WolfWithoutAClause · · Score: 5

    ...was included with windows to give you something to favourably compare the 'bomb' rate to.

    Comparisons:

    Minesweeper:

    - often explodes on the first click
    - randomly explodes later on
    - game is over quite quickly
    - you have to press the reset button to restart

    Windows:

    - often explodes on the first click
    - randomly explodes later on
    - game is over quite quickly
    - you have to press the reset button to restart

    Its the same program!

    Therefore- the Stability of Windows is NP complete! QED!

    --

    -WolfWithoutAClause

    "Gravity is only a theory, not a fact!"
  20. Re:RSA is not NP-Complete by Otto · · Score: 2

    Who's right?

    Funnily enough, they turn out to be aspects of the same thing.

    To solve minesweeper for any size board, you have to place where you think the mines are, then determine if the board is consistent. If it is, you got the mine placement correct. If it isn't, the mines are in the wrong place. This is all explained in the article.
    ---

    --
    - Give a man a fire and he's warm for a day, but set him on fire and he's warm for the rest of his life.
  21. Re:Now Minesweeper is a legitimate network tool! by Dr+Caleb · · Score: 4
    MCSE: Minesweeper Consultant and Solitaire Expert.

    --
    "History doesn't repeat itself, but it does rhyme." Mark Twain
  22. ARGH! by vsync64 · · Score: 2

    Proving the conjecture false would mean that modern encryption technology, the foundation of electronic commerce, would be open to easy attack.

    The article was cool except for this. Every single technology article has to be related to "e-commerce". Commerce this, commerce that. This has nothing to do with freaking COMMERCE! I'm sick of it. Take your stupid money and your stupid analysts and your STUPID EXECUTIVES and get them out of here!

    </rant>

    --
    TO BUY A NEW CAR WOULD MAKE YOU SEXUALLY ATTRACTIVE.
  23. many misunderstanings by snarkh · · Score: 1
    I do not know why so few people realize that the difference between P and NP has nothing to do with what is actually computable in practice. If you have a polynomial problem where the computationnal complexity is a polynomial of degree 100, no amount of computing power will help. On the other hand, there is no reason why there cannot be practically efficient algorithms for NP problems.

    While it is amusing that minesweeper is NP-complete, at least superficially, the problem of minesweeper consistency certainly seems no easier than the travelling salesman problem.

    1. Re:many misunderstanings by Ear+Phantom · · Score: 1

      I quote, from the article: "So, write a program that can decode Minesweeper for any size board, and you will join the pantheon of mathematical greats, alongside Euler and Pythagoras." Wrong! Just because something is NP or NP-complete, that does not make it suddenly impossible to solve. Any bozo who's taken a course in AI can write a heuristic to solve it. Solving it in a deterministic way in polynomial time, now that's a different story...

  24. Re:bomb on the first click never happens by jovlinger · · Score: 2

    what about you starting in an area that is completely surrounded by mines?


    XXXXX
    X434X
    X303X
    X434X
    XXXXX


    You click on the 0 to start (numbers may be wrong, sorry). the Xs represent mines. To clear the rest of the board, you have to blindly guess on a square outside your cleared area.

    That sounds "unsolvable" to me. So you need blind luck.

    NB I realise that this is not the what the article is about.

  25. Be a Salesman - Solve the P/NP Problem by (void*) · · Score: 2
    In other news, researchers have shown that solving the Travelling Salesman Problem would be equivalent to cracking the P/NP conundrum.

    "This is a problem that has me vexed for a long time" said Harvard Professor of Business, Prof Crack C. Pot. "I hadn't realized that solving this would crack the great P/NP challenge."

    "I must admit I haven't thought of it that way before," says Mary Dense Airhead, a travel agent from New York. "I mean doesn't looking through all the routes solve this Travelling Salesman Problem? What is the problem?"

    "This definitely a challenging problem," says Joe Smith, a mechanic from New Orleans. "Now I'll redouble my efforts into trying to solve it - I didn't know I could be famous if I tried!"

    "Well I don't know," says the famed Computer Scientist from Stanford, Donald Knuth. "Personally, I have always found SAT just as challenging."

    It is beyond the scope of this brief news digest to explain what SAT is. Presumably, this is too hard to explain and too esoteric. Why don't you try the Travelling Salesman Problem folks? We could all try a shot at that. After all, it's much easier!

  26. The author's webpage: by Otto · · Score: 5

    The author of this paper has a web page here:

    He also has a page specifically about this Minesweeper business here.

    I like the other paper proving that minesweeper, with a little variation, on an infinite board, is Turing-complete. Fun! :)

    ---

    --
    - Give a man a fire and he's warm for a day, but set him on fire and he's warm for the rest of his life.
    1. Re:The author's webpage: by chriscrick · · Score: 2
      I went to a talk on Kaye's work this evening at Harvard. The fact that Minesweeper boards can be used to make Turing machines is why Minesweeper consistency is an NP problem. One can define logic circuits in Minesweeper that function as complex concatenations of Boolean gates. Since solving the output of such a machine is an NP problem, so is solving the consistency of a Minesweeper board. Minesweeper logic gates are fascinating:

      Here's a representation of a wire in Minesweeper:

      . . . 111111111111111111111 . . .
      . . . xy1xy1xy1xy1xy1xy1xy1 . . .
      . . . 111111111111111111111 . . .

      Basically, if you place a mine under either the x or the y spot at one end of the wire, the rules of Minesweeper force a mine to appear under _each_ x or y all along the wire -- in other words, a binary digit propagating along the wire! The paper also describes how to make NOT and AND gates, and from such components computers can be built.

      Chris

  27. Discover Magazine has Details by BMazurek · · Score: 1
    The October 2000 issue of Discover Magazine had a more thorough article on this. For details go there.

    I checked their website, but couldn't find the article online.

  28. Re:No luck, by TheBaboonCometh · · Score: 1

    you fucking dullard

    --
    comeontheni'lltakeyouallon
  29. full of holes, it's full of holes by mingux · · Score: 5

    As with almost any mass media article about mathematics, this article is full of errors that nitpicky people like me feel the need to point out. First of all, some basic info you may be lacking. The basic P vs. NP problem is most simply stated as "P = NP?" P stands for Polynomial time, and NP stands for Nondeterministic Polynomial time, as in you can solve the problem is p(n) steps, where p is a polynomial and n is the size of the input file. Beyond that, some heinous mistakes they made: 1. P is a subset of NP, not a distinct set. Thus all P problems are NP (obviously, if you read the definition). 2. Internet encryption (at least RSA) is NOT KNOWN TO BE EVEN NP-COMPLETE. This is something I think a lot of people don't realize, and I have talked to many mathematicians who think that factorization will eventually be shown to be in P and thus RSA and all other such encryption schemes will collapse. All it takes is one brilliant hacker... 3. The answer has to do with determining consistency, which is very, very different from solving the game in a game theoretical sense. And some slightly more nitpicky issues: 1. NP-Complete problems are those problems whose solutions can be polynomial time transformed to solutions to _any_ other problem. That is why if you find a solution to the minesweeper problem, NP-Complete will cease to exist and P=NP. 2. No serious mathematician believes that P=NP. Anyone who wants to know more should read Sipser's book "Introduction to the Theory of Computation" which I highly recommend.

    1. Re:full of holes, it's full of holes by mingux · · Score: 1

      You're right about the first part - I should have said _any_ other NP problem (the classes go P

      But about the 2nd part, prime factorization is definitely _not_ suspected to be exponentially complex, because it simply isn't. For instance, one non-deterministic polynomial algorithm would be to find any one factor (try all numbers up to sqrt(integer), then find factors of those factors, etc. Since it's nondeterministic, total time is n^2 (n attempts - only n because of non-determinism - to find a factor at a cost of n each time).

    2. Re:full of holes, it's full of holes by Flambergius · · Score: 1

      > All it takes is one brilliant hacker...

      Or one lucky (and not-so-brilliant) bastard like me ...
      I just beat my previous record for Beginger level by 3 seconds. That's like the biggest improvement _ever_. And I'm on a 10-year-old laptop with almost non-working roller-ball.
      I worked for an hour to get my record on this machine down from 32 seconds and finally got it to 31. Just one more, I thought, wih little luck I can get this down under 20 seconds ... and then total of 4 clicks later, BAM, 6 seconds!

      --Flam, depressed because he's reached his peak.

      --
      Computers are useless. They can only give you answers - Pablo Picasso
  30. little more info available by magic · · Score: 1
    I tried to find more information, but there doesn't seem to be much on the net. Professor Stewart doesn't have anything on his homepage and Harvard has no further details.

    The best I could dig up was his e-mail address: hins@maths.warwick.ac.uk. The really curious might want to e-mail him.

    -m

  31. Re:It is possible... by jonnythan · · Score: 1

    That is exactly what I did :)

  32. Re:Birds on a wire by anacron · · Score: 1

    It's difficult to express how I felt when I saw the birds working out the details of moving around and adjusting. Now presumably the birds were not sitting in any particular order ... they were just sitting. So the question becomes: how do we (as humans) build a device that can take arbitrary things and just stick them somewhere without having to find out the details of specifically where it goes, or if there is room. I think that's what I was really getting at -- not so much about how to improve sorting, but how to improve read-write access.

    Another brain-bender: is it possible to know the size of a set S without counting it or counting the elements as they are added to the set?

    anacron.

  33. No luck, by Density_Altitude · · Score: 1

    MineSweeper is not open-source so we'll never have the solutoin ;-(

    --
    Density Altitude Not Available
    --

    --
    delete free(system.gc);
  34. Re:Weird by dillon_rinker · · Score: 2

    A completely blank board is a consistent Minesweeper configuration, as is a completely covered board.

    The subject of the article is not about solving Minesweeper. It's more like debugging Minesweeper. Given a minesweeper board, can you find evidence of a flaw in the Minesweeper program? If the upper left corner of your minesweeper board looked like this:

    1 1
    1 1

    ...then you'd know that there was a bug in Minesweeper. If you wrote a program that would analyze arbitrary Minesweeper boards to look for inconsistencies in them, and if your program ran in polynomial time, then you'd be famous and possibly rich.

  35. Re:Minesweeper is not free by Zorikin · · Score: 1

    If it's free, I should be able to download it for free and distribute it freely. So don't say it's free unless you can provide a working link.

  36. Re:Solving Minesweeper DOES break RSA by bigox · · Score: 1

    Factoring numbers is NOT in NP-complete. It is an NP-hard problem. It's one of those NP problems whose "certificate" is not linear in the size of the input.

  37. The links... by azool · · Score: 2

    to the Millennium Prize Problems page
    to Ian Stewart's article on the problem.
    to Stephen Cook's mathematical description of the problem (in .pdf format)
    to Richard Kaye's Minesweeper Page

    --
    Do not taunt Happy Fun Ball.
  38. Factoring is NP complete? by Anonymous Coward · · Score: 1

    Unless I'm misremembering my Algorithms class, the kind of factoring technique needed to break public key encryption has never been proven to be NP complete. It may reside solely in P.

  39. Re:Not really - let me explain by Dominic_Mazzoni · · Score: 3

    What do you mean, you can't prove it? Either P=NP, or P!=NP. If you discover a polynomial-time algorithm to solve a problem which is NP-complete, and you can PROVE it always works and never takes more than polynomial time, then P=NP. Furthermore, the proof that such problem is NP-complete would give you a way to solve any NP problem in polynomial time, so it would be true in practice, not only in theory. This article just says that Minesweeper is NP-complete, which is not a major result.

  40. Mathematical details by Imran+Ghory · · Score: 4


    More details of the maths involved can be found at The ClayMath Institute's webpage and some related papers at R.W.Kaye's webpage

    --
    -- Conexant/Rockwell Modem HOWTO http://linuxdoc.org/HOWTO/Conexant+Rockwell-modem- HOWTO/
  41. Re:NP is very bad for crypto by bigox · · Score: 1
    If you can come up with a polynomial time method that will work 75% of the time you have just broken the crypto system.

    Does that mean that Rabin's probabilistic primality test has kill crypto already? ;)

  42. Compare to "kill -9 with doom"? by Speare · · Score: 2

    Compare this to

    Yeah, they're both funny. But not very.

    --
    [ .sig file not found ]
  43. Re:The real meaning of the acronym M.C.S.E. by havoclad · · Score: 1

    Heh, I never could grok Freecell till that one week of 'Advanced NT Server Administration' class way back when.

  44. I'm pretty certain... by Art+Tatum · · Score: 2

    That Bill Gates will try to claim responsibility for this.

  45. Yeah... but how? by ka9dgx · · Score: 2

    The solution lies in minesweeper.... and no real details..

    It could just as easily lie in Freecell.

    --Mike--

    1. Re:Yeah... but how? by olim · · Score: 1

      Free Cell on the other hand can be solved easily by a computer simnply by using the brute force method. maybe, but I heard that no one has successfully proven that all possible free cell boards are solvable, so the problem can't be that simple.

    2. Re:Yeah... but how? by Code+Archeologist · · Score: 3

      It works like this. Minesweeper seems logical from the start. but your mind is actually haviong to make some intuitive jumps at critical points. Such as when you have three blocks and you know that teo of them have mines with in them. it takes an intuitive jump to come at the problem from another direction and try to solve one of the three blocks from a different edge. Straight Boolean logic chokes on this because there are not enough known values and to many unknown variables. Free Cell on the other hand can be solved easily by a computer simnply by using the brute force method. Because all of the components of the puzzle are layed out before it and it can plan each of its moves in advance... much like how a computer plays chess. it is figuring out how to get the computer to make these intuitive leaps that seperates a P from a NP problem.

    3. Re:Yeah... but how? by ka9dgx · · Score: 1
      I believe I can prove that there are boards which are NOT solvable (at least in terms of not losing).
      All you need are to points at which a pair of cells share a single mine, and the game now reverts to chance, just like quantum mechanics.

      Perhaps quantum mechanics can be reduced to minesweeper as well??

      --Mike--

  46. Re:Birds on a wire by at0m · · Score: 2

    What, how can you call that a troll? When reading it, I was thinking that I wished I had mod points so I could moderate it up... obviously you didn't understand the point of it. Linked lists do not do what he asked... they do allow you to insert things into the middle of a list, but they do not change the memory locations of any of the other nodes. He wants to be able to insert something into a specific place in memory, and have anything currently in that place be shifted. Presumably that would allow you to have the advantages of linked lists but be rid of most of the disadvantages - it could behave like a resizable array.

    There's an idea. An analog memory system that allows for overlaps of data points without data corruption. Build me that and I'll solve your NP vs P problem. That summarizes the original point, and I don't know how you could think a linked list is the solution. Maybe you didn't finish reading his post? In the future, please don't bash something that you don't understand. It's disrespectful and doesn't help anyone.

  47. Re:Either this is too easy or I don't get it by rasbora · · Score: 1

    I think what they said was that the problem was checking to see if a set of clues (the numbers in the squares) was consistent, without knowing where the mines themselves are. Imagine a board that just had all of the squares with numbers in them. That seems like it would take a lot of work to verify. Sounds like it might be equivalent to one of those tiling problems that are common examples of problems in NP.

  48. It's hard, but feasible by hex1753 · · Score: 1

    If you actually stop long enough to look at the game, it can be broken down into logical steps. A friend of mine (who is 15) has beaten minesweeper on Beginner skill in 7 seconds, and it a few minutes can conquer it on expert. I can see the troubles with the minesweeper problem, however. My friend has been in situations with 2 blocks left and neither of us could find any 'clues' to help us figure out the location of the last mine. In retrospect I think it's just impossible, that we had to miss something or the other, but it always lingers in my mind that under certain circumstances there is not enough information provided by the game to solve it right. Giving up all the Microsoft-bad-coding-practices crap, I believe the game was designed to be able to be beaten no matter what. They proclaim that every game of solitaire can be beaten, which as I think about it is also a sort of "NP" problem. If I knew how to program decently, I think I know enough about the game to write a "solving program" for it.

    ---

    1. Re:It's hard, but feasible by knuckle_curve · · Score: 1

      They proclaim that *Freecell* solitaire can always be won. Klondike solitaire is almost pure luck.

  49. It is possible... by CokeBear · · Score: 1

    I read somewhere that if you played perfectly, you could win at Minesweeper almost every time. Is this true? Does it require a certain number of squares to be uncovered before this theory kicks in?

    And just curious, what is everyone's (non-cheating) high score at expert level?

    --
    Reality has a liberal bias
    1. Re:It is possible... by Strange_Attractor · · Score: 1

      That's incorrect - consider the case of a 2x2 array of cells where the surrounding cells tell you there's only one bomb showing on each face. You could have this:
      0 X
      X 0

      or this:
      X 0
      0 X
      and there is NO way to determine which is correct without guessing. Even if everything else is solved, and you can deduce from the unmarked bombs counter that there are only two bombs left, that won't help you with this case. Actually, it's pretty rare to be able to solve an entire expert game without at least one guess like this involved.
      My best score on Expert is 70 (that was a while ago, but I still get 80s routinely, and hit 76 again last night). I've always wished someone would throw a Minesweeper tournament...

      --

      ----
      WWJD...For a Klondike Bar?
    2. Re:It is possible... by jmccay · · Score: 1

      The problem lies with the first pick. The first pick will ALWAYS be a guess. On an 8*8 grid with 10 mines you have a 15.625%(10/64*100) chance of hitting a mine. Their will always be a certain amount of randomness about the some guess. I know there are other times you'd have to guess.

      --
      At the next eco-hypocrisy-meeting, count the private jets used to get to the meeting. Should be interesting to see that
    3. Re:It is possible... by BenBenBen · · Score: 1

      Couldn't we just ask the MS person responsible for this game? Maybe they'd release the source code. Ben^3

      --
      The Slashdot Paradox: "100% Overrated"
    4. Re:It is possible... by anacron · · Score: 1

      Actually, the mine field isn't even calculated until you click a square. Your mouse click causes the field to be generated on every square save the one you clicked.

      anacron.

    5. Re:It is possible... by slackergod · · Score: 1

      Is it possible to win almost every time?
      Not exactly...

      Back in high school, for a math project, I developed
      an algorithm to "play" a game of minesweeper.
      Bascially, it maintained a large set of boolean equations,
      each variable reprenting a square. It first did a brute force on the system.
      If only one solution came up, it applied it. This actually did pretty well,
      all things considered.

      What I also had it do was then calculate the probabilities for
      each square... and the probability of being right by random choice.
      It then choose the most probable square, and prayed.
      For excessively small boards, under 10x10 and/or high mine density,
      it didn't do so well. For larger boards, however,
      it did much better. I think it was around 75%-80%
      sucessful at winning a game.

      So, to answer your question... by my algorithm, 30%-ish of the
      games are won simply by blind luck.

      I'm not sure how this relates to P=NP. It would be kinda funny if my algorthm
      was actually applicable to that, but I don't think it is.
      On the other hand, it wasn't that sophisticated an
      algorithm... I don't remember everything that clearly,
      but I think I had a slightly better one that I never fully developed.

    6. Re:It is possible... by jayhawk88 · · Score: 1

      Just curious: what verson of Minesweeper was that on? Windows 3.11/95/98? Linux version of some kind? I ask because, as you might have guessed, I used to play a lot of Minesweeper. Let's just say college work study programs are great. Not once did I ever get a bomb on the first click; a fact that actually became a point of debate between myself and several others in the campus computer lab back in the day. We wondered whether the board was generated on load, and the bomb moved to another space if you click on one first; or if the board was generated after the first click.

      As for my being a Windows user, AC, I admit it freely, no shame. When your a support technician, you use what the lusers use baby.

    7. Re:It is possible... by Quikah · · Score: 1

      I forget exaclty, haven't really played in a while, I think it is in the 90s, maybe l00 something. I remember intermediate was 38, beginner is useless.

      Needless to say I have played minesweeper way too much. Had a year of silly minesweeper rivalry in college with my friends. We eventually gave up on expert and starting doing custom games with 160 or so mines on largest board.

      --
      Q.
    8. Re:It is possible... by inkydoo · · Score: 1

      My experience from years ago, was that sometimes Minesweeper cannot be won logically. The situation that comes readily to mind was when there were two bombs in a corner somewhere. what you would get is something like this (my apologies if this is hard to read)

      Where the top left corner is actually the corner of the screen, X represents an uncovered square, and F means a flagged square

      -----------
      |X|X|1|0|0|
      -----------
      |X|X|2|1|0|
      -----------
      |1|2|F|1|0|
      -----------
      |0|1|1|1|0|
      -----------
      |0|0|0|0|0|


      Now, if you know that you have two bombs left, it is completely ambiguous where the bombs are. They are obviously diagonal to each other, but whether there is one in the top left corner or not is ambiguous.
      As far as I can tell, when you find yourself in this situation, you have a 50/50 chance of winning.

    9. Re:It is possible... by bmongar · · Score: 1

      I don't beleive so, though I can't think of the example off the top of my head. I think there are situations where the clues are insufficient, and you have to take a guess.

      --
      As x approaches total apathy I couldn't care less.
    10. Re:It is possible... by rlk · · Score: 1

      One pattern that is a pure random guess (I hate it when I reach the end of the game and have this. If I see it, or a related pattern, I take the guess on the spot to save time):

      X X X
      3 ? 3
      1 ? 1
      -----

      You have absolutely no information about which of the two ? points is the mine and which is clear.

      I like to start in the corner. My reasoning is that there are only three surrounding cells, and thus there is a better chance that there will be no adjacent mines. Having no adjacent mines clears additional territory and gives me more known points of attack. When the corners are exhausted, and there are no more provable clear points, I try edge points for the same reason (only five surrounding points). The idea's not to change the risk of hitting a mine (this has no effect on that), but rather to improve the chance of hitting a clear region that allows me more points of attack. I haven't kept track (and I always make sure to remove minesweeper after I install a new version of Gnome or KDE after playing a game or two, or else I'd never have any spare time), but I'd SWAG that I win on the order of 15-20% of the time at expert level.

    11. Re:It is possible... by netbiker · · Score: 1

      Just to satisfy your curiosity: on standard W*ndows Minesweeper Expert Level: 56 seconds. On the Psion 5mx Expert Level: 37 seconds.

      Does that make me the answer to the whole P/NP thing? Or just an idiot with too much spare time on his hands?

      netbiker

      --
      cd /pub ; more beer
    12. Re:It is possible... by Wog · · Score: 1

      With minesweeper, you have to have a starting point, so some amount of random clicking is needed to get something to work with. Once you get a few squares uncovered, though, all that is needed to win is patience. The reason many people don't do well is because they rush through and "guess", while more accomplished players recognize that each move must be painstakingly considered.

      Just a second... maybe that's the point! Any encryption can be broken with sufficient random clicking. :-)

    13. Re:It is possible... by pythorlh · · Score: 1

      Unfortunately, at expert level there is a rather high chance of getting multiple consistant solutions, ie the mines remaining cannot be determined without guessing. I've never done a statistical study, but I would guess around 40% of the generated fields have this problem... Also, of course you have to be lucky enough to avoid mines in your first few random clicks. high score...I think around 186 seconds...:)

      --
      Do not confuse duty with what other people expect of you; they are utterly different.Duty is a debt you owe to yourself.
    14. Re:It is possible... by jonnythan · · Score: 2

      Just to test, I just fired up minesweeper and started clicking. On about my 20th try, my first click was a bomb.

      Sorry.

    15. Re:It is possible... by Moxen · · Score: 1
      Yes, well, if you wait until the end of the game and have either one or three mines remaining, you won't have to guess.

      But then, there will always be ambiguous configurations. They just come up less than most people think.

    16. Re:It is possible... by �nubis · · Score: 1
      You can not necessarily win every minesweeper game you play, even if you play perfectly.

      For example, on the very first 'move' you always have a chance of uncovering a bomb... no matter how good a player you are.

    17. Re:It is possible... by techwatcher · · Score: 2

      As an occasional player (I don't find it addictive at all!), I have to say the most important move is the first move, and that the second move always involves guesswork also. If the first move uncovers a "1," I try a second move on an adjacent square (which has a 7 in 8 chance of not blowing up). If I haven't uncovered a "1," I usually click on a second random square, hoping for a "1."

      Sometimes after the second or third move the game becomes completely soluble by logic alone, but sometimes the configuration is such that yet another random move is necessary quite late in (more than halfway into) the game. That's why I don't believe Minesweeper is in principle soluble through logic.

      On the other hand, I find Freecell fascinating, and keep trying to work out algorithms to solve each game first time through. There's a principle similar to the Hippocratic oath ("first, do no harm") which seems to work pretty well! It translates roughly into, "Can I see how to get back to the same number of free cells after this move?"

      Wasn't there, in _Cryptonomicron_, a very careful and thorough explanation of the problem of (algorithmic) solubility/non-solubility? I found that explanation (which wasn't exactly exploring P/NP) very useful.

    18. Re:It is possible... by namespan · · Score: 2

      Just a second... maybe that's the point! Any encryption can be broken with sufficient random clicking. :-)

      Well, yes. This is called brute force. Of course most of the time it's easy to think of brute force being a sequential trial of everything in the keyspace, but it doesn't have to be (although that guarantees you try every key only once).

      Suffecient would be the trick. :)

      --
      Libertarianism is rich wolves and poor sheep playing gambler's ruin for dinner.
    19. Re:It is possible... by nmx · · Score: 1

      Only on the Palm Pilot. Windows Minesweeper guarantees that the first click will not be a bomb.

      --
      "Well kids, you tried your best, and you failed. The lesson is, never try."
    20. Re:It is possible... by davmct · · Score: 1

      high score: 76 seconds on Expert. I have too much time on my hands though.

    21. Re:It is possible... by sikboy · · Score: 1

      No you don't. At least, not with mine. I have never, ever hit a mine with my first click. I think it removes the mine if you are unlucky enough to get it right off the bat. Sik

    22. Re:It is possible... by KahunaBurger · · Score: 1
      I've had the same expereince. Pure luck comes into play at the very begining where you have to click around till you get an open space, and often at the very end where you can end up backed into a four square ending with a diagonal one way but you don't know which.

      At my time of greatest addiction, I think I broke the 100 sec barrier, but I use the "clear all the spaces that arn't flagged around this number" semi-cheat, so I don't know if I am worthy of contention.

      -Kahuna Burger

      --
      ...will work for Chick tracts...
  50. "Taipei" != Mahjongg by Howie · · Score: 1

    Personally, I kinda prefer mahjongg or tetris tho ;)

    I hope you mean mahjongg and not one of those patience games that uses the same tiles... not the same thing at all.

    --
    "don't fall into the fallacy of believing that Perl can solve social problems. Maybe Perl 6 can, but that's a ways off"
  51. This was in the most recent Sci Am ..... by taniwha · · Score: 3

    and the issue isn't about PLAYing minesweeper - but deciding whether a particular position is self-consistant - a whole different thing

    1. Re:This was in the most recent Sci Am ..... by mangu · · Score: 1

      ...but it's not in the boston.com link mentioned above...

    2. Re:This was in the most recent Sci Am ..... by cetan · · Score: 2

      Yes. Pages 94-95 of the October issue of Scientific American has a very good article about Mindsweeper and P vs. NP. unfortunatly the article is not available online at sciam.com

      --
      In Soviet Russia...michael would be rotting in Siberia!
  52. Re:What if your first guess is a mine? by kgutwin · · Score: 1

    not possible with Windows minesweeper - for a map H high by W wide, you can only have a maximum of (H-1)*(W-1) mines and a minimum of 10 mines.
    Sorry...

    -Karl

    --
    [root@kgutwin /dos]# file msdos.sys
    msdos.sys: fsav (linux) virus (17518-87)
  53. Ah.. by Electric+Angst · · Score: 2

    I see now... Minesweeper is the enemy of encryption. This just goes to show that Windows really is a security risk. (As if we needed more proof of that...)
    --

    --
    Feminism is the wild notion that women are human beings.
    1. Re:Ah.. by AntiNorm · · Score: 2

      I see now... Minesweeper is the enemy of encryption

      So does this mean that Minesweeper is illegal under the DMCA? ;)

      =================================

      --

      I pledge allegiance to the flag...
      of the Corporate States of America...
    2. Re:Ah.. by user · · Score: 1
      So does this mean that Minesweeper is illegal under the DMCA? ;)
      No no no... *solving* a game of Minesweeper, or telling someone else how to do so, is illegal under the DMCA. :)

      -User

      --

      Emacs is for experts. Pico is for beginners. VI is a disease.

  54. More details... by Rob+Parkhill · · Score: 2

    A much more detailed story is found at The Clay Mathematics Institute Website

    --
    "Tomorrow's forecast: a few sprinkles of genius with a chance of doom!" - Stewie Griffin
  55. Math, Secondary Ed by namespan · · Score: 4

    I've always thought that one of the problems with math -- as taught at the secondary level -- was that you didn't actually learn any abstract math skills (well, you might, but you're not taught them). Just more algebraic manipulation, or, if you're luck, the foundations of calc.

    I think games and optimization problems, though, could provide a fertile and interesting framework for teaching real mathematical thinking. Minesweeper. Knight's Tours. John Conway's games. Nim. Dominoes. Any small, discrete system with definable rules can get you thinking mathematically, though most people probably just play with heuristics....

    --
    Libertarianism is rich wolves and poor sheep playing gambler's ruin for dinner.
  56. Solving Minesweeper DOES break RSA by cameldrv · · Score: 1

    Actually part of proving a problem is NP complete is reducing it to another NP complete problem by showing how to encode the problem as another type of problem, and subsequently decode the answer. Hence, if you find the polynomial solution to minesweeper, just use the chain of encodings used to prove the NP completeness and you have a polynomial solution.

    1. Re:Solving Minesweeper DOES break RSA by xyzzy · · Score: 2

      Right, ok, go ahead: show how minesweeper is equivalent to factoring large numbers :-)

      I submit to you that knowing that a path exists out there and actually finding it is a hard task in and of itself. As I said, all you've proved is that the solution DOES exist.

    2. Re:Solving Minesweeper DOES break RSA by cameldrv · · Score: 1

      You've missed the point. The proofs provide a specific encoding. I'll try to dig it up if I have time.

    3. Re:Solving Minesweeper DOES break RSA by /dev/kev · · Score: 1

      I think what he was trying to say is that it'd be easier to find the path than to find a direct polynomial time algorithm. Particularly when it is common to reduce 3SAT (or Vertex Cover, etc) to the problem you're proving NP-Complete. Then you could use the Cook-Levin theorem to get to any problem you choose. Of course, we all know how efficient an implemention of the Cook-Levin construction would be, don't we? :)

      Proving that a solution exists is important. It means that you're not wasting your time looking for it. With hard problems like NP ones, proving the existence of what you're looking for is a good idea.

      --
      Quidquid latine dictum sit, altum viditur.
  57. NP is very bad for crypto by Zachary+Kessin · · Score: 3
    NP complete problems are not very useful for crypto. It turns out that for many NP complete problems you can find a much faster solution that will work some of the time. All NP says is that in the *WORST* case senario it will be expontential time to solve. If you can come up with a polynomial time method that will work 75% of the time you have just broken the crypto system.

    The Cure of the ills of Democracy is more Democracy.

    --
    Erlang Developer and podcaster
    1. Re:NP is very bad for crypto by interiot · · Score: 2

      That is, unless the worst case scenarios are easy to identify, in which case, you'd only pick those keys.
      --

    2. Re:NP is very bad for crypto by swinge · · Score: 1

      That is, unless those easily identified worst case scenarios were few in number, in which case, picking those keys would be too easy to guess.

  58. Old Hat by Orifice · · Score: 1

    This is old hat. I read about it a couple months ago. Tell me something I don't already know.

  59. Reason why this CANNOT be done via a program by OaXlin · · Score: 1

    Solve this one with a program, if you can...

    111111
    2*33*2
    3*??*3
    2*33*2
    111111

    Which '?' has the mine..... and remember NO GUESSING ALLOWED

    --
    sig. "I didn't do it."
  60. Try this by GeekDork · · Score: 1

    `This is already enough... (0 marks yet unknown positions) 3?000... ??000... 00000... 00000... . . . So what?

    --

    Fight hunger. Filet a politician and send him to a 3rd world country of your choice.

  61. Re:Try this (Sorry, I screwed it up...) by GeekDork · · Score: 1
    This is already enough... (0 marks yet unknown positions)

    3?000...
    ??000...
    00000...
    00000...
    ...

    what next?

    --

    Fight hunger. Filet a politician and send him to a 3rd world country of your choice.

  62. Re:RSA is not NP-Complete by esh · · Score: 1

    Now we finally know what a Microsoft Certified Professional (MCP) degree is good for. These people know how to determine whether a MineSweeper layout is consistent.

    Is there an equivalent problem for the Solitaire Expert? ;-)

    --
    -- ESH
  63. Yeah, where is the article? by polymath69 · · Score: 1

    I did a search on boston.com for "minesweeper" and turned up nothing. Does anyone know the exact URL for the story?

    --

    --

    --
    I don't want to rule the world... I just want to be in charge of mayonnaise.
  64. my minesweeper by defenestrators · · Score: 2
    A bit tangential, but it may amuse some: My Minesweeper

    Ted

  65. MCP = Master Control Program! by Otto · · Score: 1

    Now we know what Tron was *really* all about. It all makes so much sense!
    ---

    --
    - Give a man a fire and he's warm for a day, but set him on fire and he's warm for the rest of his life.
  66. hmmm...repost? by joedumb · · Score: 1

    hmm... looks like this article has been reposted on slashdot before... http://slashdot.org/articles/00/10/10/1222226.shtm l

  67. Minesweeper is NOT that difficult to "solve" by Restil · · Score: 2

    Contrary to popular belief, minesweeper is not that difficult of a game to solve, but only after you have found your first mine. Up until that point, you HAVE to guess. the game, however, does not draw the board until after your first move, as your first move will ALWAYS be safe. However, unless your first move hits a spot that has no mines surrounding it, your next move will HAVE to be a lucky guess. However, once you have reached a certain point, like after successfully rooting out about 5 mines, the solution becomes pretty much a linear problem based upon the number of grids on the board.

    There are a few "traps" however. Ones I have learned to avoid by always cleaning out the corners first on a large board. If I die, I want it to happen in the first few seconds and not on the last grid I'm trying to clear.

    Encryption, as far as I've been able to deduce, does not allow for this strategy. While I know that it might take 2^56/2 average brute force comparisons to extract a DES key, there is no plateau I know of, say at 2^10 comparisons where I can safely say that the problem becomes a linear problem rather than an exponential one.

    Take for instance a 10x10 minesweeper board. If I simply wanted to brute force out a solution, I have 2^100 possibilities (yes, this makes encryption look tame by comparison). However, we can break this problem down significantly without even knowing any tricks. Take a board. Guess at a grid. If the grid is clear, we go onto the next one, if the grid is occupied by a mine, we will know this instantly as well. This problem still has 2^100 possibilities IF the game restarts each time you die and you get a fresh board. HOWEVER, if the board remains the same, you have only 200 possibilities total and you will have the board complete. I can't do this with encryption. I can't guess at each bit of a key indifidualally to determine if it is right or wrong. If I could, then DES could be solved with no more than 112 instructions. And even 128 bit encryption would take no more than 256 iterations.

    But minesweeper isn't that difficult. There are very few boards (especially on the 10x10 grid) that can't be solved with a predicable algorithm. While it is not possible to know with certainty if EACH grid location is definitely a mine or definitely not a mine, you are about 99% likely to know at least ONE of them at any one time, after the initial 2-3 guesses. This is better than we have for encryption, but still falls short of the rule as we need to be 100% sure for ANY board.

    Encryption does not suffer. Even if for an encryption scheme with 2^N possibilities, I would be able to determine an absolute solution in less than 2^(N/10) possibilities, for DES this would be about 32 possibilities, the problem can be made more complex simply by increasing the bitsize of the key. A key with 1024 bits would, with this method, require 2^102 possibilities which is still out of the range of today's computers, or even tomorrow's.

    -Restil

    --
    Play with my webcams and lights here
  68. Re:render encryption useless? by baxissimo · · Score: 1
    if you find a P solution of an NP-complete problem

    Sure if you find a P solution to an NP-complete problem, you're all set. But I'm allowing that some genious might find a quirky way to prove P=NP without actually showing that any particular NP complete problem can be solved in P time. Similar to how the pigeonhole theorem can tell you that there must be two people in New York with the exact same number of hairs on their heads, but it doesn't tell you which two.

  69. Re:Minesweeper is not free by Psi-kick+Guy · · Score: 1

    Nope.

    You're still PAYING for it, because you don't get it unless you pay the price.

    You're paying less for the cereal.

    You think the boxes are free too?

  70. wrong on all accounts by q000921 · · Score: 4
    • Solving the minesweeper consistency problem is not sufficient for playing minesweeper optimally (and it may not even be necessary).

    • There are lots and lots of games that are NP complete. It's a fun but elementary exercise for undergraduate CS majors to think about these. Sometimes, that contributes a useful insight to the N=NP question, but usually, it does not.

    • Proving that "minesweeper consistency" is NP complete probably doesn't make it any easier to establish P=NP or P!=NP; there are lots of NP complete problems, some of them much better suited to an attack on this problem.

    • Cryptographic methods, and RSA in particular, often rely on factoring, not NP completeness.

    • So, write a program that can decode Minesweeper for any size board, and you will join the pantheon of mathematical greats -- Actually, it's easy to write a program that does this. The question is whether it runs in polynomial time in the worst case.

    • NP completeness has lost much of its lustre since its discovery. Many NP complete problems have good, practical solutions, and many known polynomial time problems lack good, fast solutions. These days, randomized complexity and circuit complexity are probably of more practical interest, and there are lots of more interesting, outstanding problems there.

    Besides P = NP for N = 1 (:-).

    1. Re:wrong on all accounts by johnathan · · Score: 1
      Besides P = NP for N = 1 (:-).
      Or, as most theoreticians believe to be more likely, when P = 0.

      --

      --
      You don't need a weatherman to know which way the wind blows.
  71. My old boss could have used this by jon_adair · · Score: 1

    One day I swapped the bitmaps for the 3 and 4. About a week later, he was playing it while he was on the phone. When he hung up, he freaked out. He was convinced there was a bug in Minesweeper. He even said "there's no way you guys did this one." We managed to last about 5 minutes before we were laughing our asses off.

  72. UC Berkeley's new class... by willis · · Score: 1

    Check out http://www-inst.eecs.berkeley.edu/~cs70 I'm taking it now -- it's a great class. willis/

    --

    there is no thing
    what else could you want?
  73. Not worth it by 2Bits · · Score: 1
    I mean, in order to win fame and that one million bucks, you have to venture into the mine fields, many times?

    There are better ways to achieve that.

  74. MODERATORS.. by Beatles · · Score: 1

    The previous post should be moded up +1 Insightful, please take this step or I will be forced to sue, thank you...

  75. This is tripe. by DiningPhilosopher · · Score: 2


    Okay, so there's a journal article which discusses a problem contained within Minesweeper. In order for this to be interesting, he would have had to prove the problem NP-complete and provide a polynomial time solution for it. As far as we know he did neither. The gist of the article is, "There's a theoretical problem in Minesweeper, and gosh, isn't the P=?NP question interesting?"
    Furthermore, even if a proof that P==NP were handed down by God encryption wouldn't become useless. Most of the fundamental problems in encryption are not provably NP-complete.

    --
    /* The beatings will continue until morale improves. */
  76. Professional Minesweeper by GoNINzo · · Score: 2
    Like many people, I play minesweeper obsessively. But thanks to Pat for an amazing x-mas present one year, I found something more challenging than the same board over and over again. If you like Minesweeper, and are on a Windows machine, check out Professional Minesweeper. They have 18 different boards, with support for English, Finnish and Croatian languages.

    It's Very challenging. I do it as a hobby, and currently have some amazing scores for it. Currently, I have a low of 107 for the regular level, with an 82 on my favorite level, crossed squares. It took me approx 4 months of solid play to get the 149 on Diamond, it's REALLY hard.

    You can find the author, Bojan Urosevic's original web site. It's shareware, but I highly recommend you purchase it because it's such a great game.

    --
    Gonzo Granzeau

    --
    Gonzo Granzeau
    "Nothing the god of biomechanics wouldn't let you into heaven for.." -Roy Batty
  77. No big news here.... by corecaptain · · Score: 2

    This article is mainly publicity - no realbreakthrough - which is okay if you want to inform the public about P vs. NP problems. Unfortunately, to the average reader of the article it would appear that there has been a new development just because someone has shown minesweeper to be equivalent to other known NP problems. The key to proving P=NP or P!=NP does not lie in the game minesweeper anymore than it lies in any of the many other known NP problems. The only real news here is that a problem stated in terms familiar to minesweeper players is an NP problem. Ho hum.

    1. Re:No big news here.... by (void*) · · Score: 1

      Mod this up insightful!

  78. Re:Weird by EboMike · · Score: 1

    The first square chosen MUST be random. There are no clues as to what may lie under the first square clicked.

    Not quite true, since Minesweeper will simply not allow you to click on a mine on your first attempt. It'll highlight the square when you click on it but it'll refuse to uncover it.

    Still doesn't mean squat since your first click might be completely useless (just one "1" uncovered, nothing else), so once you again you're up shit creek without a paddle.

  79. Re:Either this is too easy or I don't get it by Anonymous Coward · · Score: 1

    I have always concidered the factoring issue to be kind of misleading. Yes, the composite number can be retrieved from the public key, and assuming you could quickly generate a list of the factors, all you would have to do then is try each one of the factors to create a test key and try it. Some encryption programs such as PGP are even nice enough to provide a CRC to tell you if you got it right.

    But concidering the time it would take to factor the composite number, and the number of factors that could potentially exist, would this really be faster than a smart brute force known / guessed message attack? Using PGP 2.6 as an example, it uses public key RSA to encrypt a session key and other settings type information for a stream cipher. The data structure of this information is well known, and several field have limited legal values, creating bits of the message that can be known. We already know who the message was intended for and assuming their public key is well published such that we can acquire a copy of it, then we have the tools needed to encrypt test messages to see if they match the final encrypted original message. Using the number of bits that end up matching the original we can potentially use that as feedback to determine which message bits contain the correct bits or not and try setting different bits. I may be missing a fundamental characteristic of modular arithmetic, but it would seem to me that such a smart brute force attack could be done in N-bit squared or cubed time rather than the reported 2 to the N-Bit power time.

    If this will work, it is not an instantaneous solution, but it would greatly reduce the required work needed to crack a message.

  80. See also previous post by duckpinned · · Score: 1

    then why, when I use xyzzy (mentioned above by yours truly), do I apparently have a valid minefield before I've even clicked? I've tried flagging bombs before I click a spot, and the squares indicated as bombs remain so after I start opening up the ones indicated as not being bombs. Then it's easy to beat 100 sec on expert, but then, that's why it's cheating to use it. Then again, it never seems to "see" all of the bombs that there are supposed to be on the field before I start. For example, with begginger level, and only 10 bombs, it's pretty easy to be sure that you got everything the cheat was telling you about, but there's usually only 8 indicated, and, just like I said in my previous post, if your first click is on one indicated as having a bomb, there are 3 places that "turn out" to be bombs that were previously indicated as not being them. whether or not this is actually not determined until the first click, or this is a flaw deliberately built into xyzzy, I have no idea.

  81. Re:Minesweeper is not free by piku · · Score: 1

    Nope the prize is free. You pay for the cereal. The toy is a bonus. The price for the cereal is the same whether there is something extra in the box or not.

  82. Re: Winning at Minesweeper. by Michael+Jennings · · Score: 1


    It really is possible to win at Minesweeper by defining and solving sets of simultaneous linear binary equations. I wasn't pulling your leg, and I wasn't bragging.

    The solution is too simple to mention. I suppose that anyone who knows how to solve simultaneous equations would be able to solve them when the numerical base is binary.

    I assume that whatever mathematical problem they are discussing actually has nothing to do with winning at Minesweeper.

    20 percent of the people in the world don't have enough to eat. So, winning at Minesweeper hasn't seemed like an important pursuit to me. I discovered that it was possible to write binary equations that show where the mine cannot be. I presume many other people have discovered the same thing.

  83. Re:RSA is not NP-Complete by readams · · Score: 2

    Actually, any NP problem can be reduced in polynomial time to any NP-complete problem. Solving any NP-complete problem in polynomial time proves that every problem in NP is in P.

  84. Re:fun with minesweeper by jck2000 · · Score: 3
    In looking through old floppies the other day, I came across the attached very-pseudo-code "Solution for Minesweeper", which I put together a number of years ago. I think I got half way into coding it and then abandoned it for some other pointless problem with bad O() attributes.

    The basic idea is, given the current displayed numbers and the number of remaining mines, generate all possible patterns of mines in the adjacent undisplayed squares and then figure out the probability that each undisplayed square has a mine. I am not sure I follow what I was doing, but I thought some might find it amusing.

    *************

    SOLUTION FOR MINESWEEPER

    1. Read in minefield and translate into a code where each square is assigned a number between 0 and 10, with 0 through 8 representing the displayed number of adjacent mines, 9 representing an unknown square and 10 representing a displayed mine.

    2. Iterate through each square in minefield (indexes: [x][y]). If such square has a value of 0 through 8, save value of square in nNetAdjMines and test adjacent squares for "unknowns" (indexes: [c][r]). If an unknown is detected, (i) increment nAdjUnk, (ii) increment AdjUnkTable[c][r] and (iii) add a [c][r] node to pointer in KnownTable[x][y]. If a mine is detected, decrement nNetAdjMines. If nNetAdjMines>nAdjUnk, an error has occurred. If nNetAdjMines==nAdjUnk, then all unknowns for square [x][y] are mines; in such case, add [x][y] to minelist, and, after processing the entire minefield, reveal all mines on minelist and go to step 1.

    3. Count all known, non-mine elements of KnownTable (nAK). Create array of nAK pointer elements (KnownArray). For each known, non-mine element of KnownTable, set a pointer in KnownArray to such element.

    4. Count all non-zero elements of AdjUnkTable (nAU). Create array of nAU integers (AdjUnkArray). For each non-zero element of AdjUnkTable, reset the pointers in the linked list of each element of KnownArray to point to the corresponding element of AdjUnkArray.

    5. Place each possible binary pattern of mines/non-mines in AdjUnkArray. If more mines are used than available, junk pattern right off the bat.

    6. Test each such pattern by checking whether, for each element of KnownArray, the sum of the dereferenced pointers on the linked list equals nNetAdjMine. If it does, then call FinalArray(x,y,nMines), which, for a [x][y] square, increments a counter of an element in an array (CountArray) which indicates, for a given number of mines contained in AdjUnk squares (nMines), the number of patterns in which [x][y] would contain a mine.

    7. For each KnownArray element, a "Factor" (equal to the number of different patterns that could be made by placing totMines-nMines mines in the non-adjacent unknowns) is applied to each CountArray element to account for the relative numbers of occurrences of the different nMines. The Factored counts are added for each CountArray element for such KnownArray member and the totals are divided by the total number of all possible patterns.

    8. The relative probabilities that each unknown is a mine is displayed and/or the least probably unknown is selected. All unknowns having a 0% chance of being a mine are selected and all unknowns having a 100% chance are flagged as mines.

  85. Re:Not really - let me explain by Anonymous Coward · · Score: 1

    You're confusing nondeterminism with randomness. They are NOT the same thing. Nondeterministic algorithms do not involve "guessing" at all. To prove that a problem is in NP you have to show that any solution can be verified in polynomial time. That's it. I recommend Sipser's book for a superior explanation of the topic. Taking his class is even better.

  86. Re:fun with minesweeper by Fesh · · Score: 1
    You mean that a guess always results in a mine going off in your face? I thought that was the way minesweeper was programmed in the first place! I've always had the sneaking suspicion that it just makes random decisions on whether a mine is in the space you just clicked...

    *grin*


    --Fesh
    "Citizens have rights. Consumers only have wallets." - gilroy

    --
    --Fesh
    Kill -9 'em all, let root@localhost sort 'em out.
  87. Re:Proving P=NP does not make breaking codes easie by tofupup · · Score: 1

    You are wrong ... first problem with your argument is that the number n would be given in binary ... and by applying blum's speedup theorem to this arguement ... it would be possible to colaspe the 100 to an arbitary number say 2. Theory kicks gnads.

  88. Clarification of a P vs. NP problem? by dmatos · · Score: 1

    Okay, I've read your other posts. I see your point about most of these posts having the wrong idea. However, could you please clarify what a P problem would be? Would that be one which is O(n^x) where x is any constant, and n is a parameter for the problem? For example, if this could be solved in O((length_of_board*width_of_board)^20) is that a P problem?

    Surely there must be a better way to check consistancy than a brute force check of all mine positions possible in the unmarked squares. I think I have a new hobby now...

    --

    It may look like I'm doing nothing, but I'm actively waiting for my problems to go away.
    --Scott Adams
  89. Bzzzt. Wrong. by Spankophile · · Score: 1

    I'm sure it's just that I haven't read enough comments to find someone else whose clarified this.

    The actual GAME of minesweeper IS NOT NP Complete!!

    Given a particular minesweeper board, except for times where no logical decision is possible, the game is COMPLETELY deterministic (you use deduction to figure out which box you click next). The "guessing" involved in NP is NOT the same as the guessing you do with the lack of information provided in some Minesweeper boards.

    What *IS* NP complete is the CONSISTANCY of the Minesweeper board. Ie. Given a minesweeper configuration, is a solution POSSIBLE.

    For example, a board with a 9 would be inconsistant because it can't possibly have 9 bombs around it. Likewise, a square with a 2, and all but one square uncovered would be inconsistant.

    In short: Solving the game is not the problem. The problem is: Given a board, without making any more moves, is it possible that a solution exists.
    That problem is NP-complete.

  90. bomb on the first click never happens by duckpinned · · Score: 1

    You can verify this using the xyzzy cheat documented in the Jargon File. If you're not familiar with it, it turns the a small area at the upper left of the screen either black or white depending on whether the mouse pointer is over a bomb or not. It doesn't exist in some versions of windows, but I happen to use one that does, on occasion, and if your first click is on a square indicated as a bomb it won't be anymore. I don't know whether the game completely regenerates the board or just randomly picks a different square that was previously bomb-free to replace it, however.

  91. mahjongg.... by Fishbulb · · Score: 1

    If you like mahjongg, check out xshisen. Slightly simpler, very addictive. ;)

    http://www.techfirm.co.jp/~masaoki/xshisen.html

  92. Goldbach's Back Yard by twisty · · Score: 2
    Goldbach's Conjecture is a veritable forest of discovery. Once I write up my proof for it, I plan to move on to Reimann's Hype and P=NP. ;-)

    Ya see, GC has puzzled mathematicians for 258 years because it's easy to "see" relationships immediately, but each of them is difficult to prove. Once proof is offered, it will be easy to verify, much easier than Fermat's 150pg proof, just like P=NP solutions are quickly verified.

    GC lends well to P=NP, because finding composite numbers (non-prime) is a classic example of one of those tasks that requires checking through every permutation. Minesweeper is a pattern-matching exercise that is not far from finding which prime patterns (twins, quartets) are workable and which are invalidated by congruencies (modulas) of other primes.

    On my way to solving GC, I think I accidentally proved both the Hardy-Littlewood conjectures, and thus disproved the disproof against them! :-D

  93. Minesweeper is not free by DVega · · Score: 1
    Minesweeper, which is included free with the Windows operating system ...
    It's not free (like beer or speech)! It's included with Windows, Windows is not free, so Minesweeper it's not free.
    --
    MOD THE CHILD UP!
    1. Re:Minesweeper is not free by piku · · Score: 1

      FREE WITH the operating system.

      So yes it is free.

  94. If someone solved this... by enrico_suave · · Score: 1

    Could then use it to predict the stock market?

    hmmmm... where's my drill

    E.

    --
    Build Your Own PVR/HTPC news, reviews, &
    1. Re:If someone solved this... by peter · · Score: 1

      the problem with predicting the market is not that it takes too much CPU time to solve, but rather that we don't know any algorithms of any complexity class that predict it.
      #define X(x,y) x##y

      --
      #define X(x,y) x##y
      Peter Cordes ; e-mail: X(peter@cordes , .ca)
  95. The real meaning of the acronym M.C.S.E. by b0z · · Score: 3

    MSCE = Minesweeper Competent Solitaire Expert. I have sat through some of the classes (NT 4.0 Core, MS-SQL Server 7.0 Admin, etc) and yes, I have become a minesweeper and solitaire expert. So, we have plenty of people such as myself that have had training in these complex programs, since we had to do something while the instructor blabbered on about some corny jokes to try to liven up the classes. I'm not MCSE certified, but I am pretty damn good when it comes to solitaire and minesweeper. I have been improving on my freecell skills, and I have already mastered the pinball game that comes with NT. WOOHOO!

    --
    Mas vale cholo, que mal acompañado.
  96. Insufficient clues - happens all the time by dmatos · · Score: 2

    Consider the following situation, against the top edge of the board:
    --------
    01?10
    13?31
    1***1
    12321

    In my experience, this usually happens around the edge of the board, but there are times when it will happen smack dab in the middle as well.

    --

    It may look like I'm doing nothing, but I'm actively waiting for my problems to go away.
    --Scott Adams
    1. Re:Insufficient clues - happens all the time by Surt · · Score: 1

      See my comments elsewhere ... the problem is not really solving minesweeper, but verifying that the board you have presented does not represent an impossible situation (the situation you present is quite possible, and a program that can deduce this in P would be the goal.)

      --
      "Who is the Journal of Quantum Physics going to believe?" --Stephen Hawking
  97. Re:Do I get a million dollars? by Surt · · Score: 4

    Unfortunately, this is not the minesweeper solving problem. It is the minesweeper consistency solving problem. 2 correct examples of the consistency problem:

    X = MINE
    O = COVERED EMPTY
    NUMBER = BOARD CLUE

    1 X
    X X

    The correct analysis of this board would be 'inconsistent'.

    2 X
    X O

    The correct analysis of this board would be consistent.

    The minesweeper consistency problem is a matter of checking the board and being able to declare whether or not the board is correct in all of its details.

    The challenge is to construct a program which will process all generalized minesweeper boards and declare them correct/incorrect (accurately) in P. IF you can write such a program, then NP=P.

    --
    "Who is the Journal of Quantum Physics going to believe?" --Stephen Hawking
  98. RSA is not NP-Complete by Otto · · Score: 5

    RSA is only NP, or at least nobody's proven it to be NP-Complete yet.

    Any NP-Complete problem can be transformed into any other NP-Complete problem via a polynomial time transformation. Thus, solving one solves all. I have no idea how to do it, it's over my head. But it can be done.

    Anyway, more to the point, this isn't about Minesweeper, it's a problem called the "MineSweeper Consistentcy Problem" and it's important to remember that. Essentially, the MCP is: given a half finished minesweeper board, is it consistent? That is, is it a valid board within the rules of the game? It is possible to get this board through normal play?

    That's a bit of a different beast than just playing the game, guys.

    ---

    --
    - Give a man a fire and he's warm for a day, but set him on fire and he's warm for the rest of his life.
    1. Re:RSA is not NP-Complete by kubalaa · · Score: 1

      So my question is when do we get a Minesweeper-based encryption algorithm?

      --

      "If you look 'round the table and can't tell who the sucker is, it's you." -- Quiz Show

    2. Re:RSA is not NP-Complete by Thing+1 · · Score: 1
      Otto said:

      Anyway, more to the point, this isn't about Minesweeper, it's a problem called the "MineSweeper Consistentcy Problem" and it's important to remember that. Essentially, the MCP is: given a half finished minesweeper board, is it consistent? That is, is it a valid board within the rules of the game? It is possible to get this board through normal play?

      From the article:

      So, write a program that can decode Minesweeper for any size board, and you will join the pantheon of mathematical greats, alongside Euler and Pythagoras.

      Who's right?

      I'll add one observation: I have managed, on several occasions, to get to a state where there are N uncovered squares and N-M bombs left, and no clues as to which is right -- it's a coin toss.
      --

      --
      I feel fantastic, and I'm still alive.
  99. Score 4.85 Informative on K5 by Ramses0 · · Score: 1
    He re's a first post that's amazingly on-topic, it does a really good job of explaining what the article is actually talking about.

    (plus Kuro5hin readers wisely voted this story section only, probably where it belongs)

    --Robert

  100. NO! Don't Post The author's webpage... please... by namespan · · Score: 2

    Arg! Do you realize what you've just done?

    This is just like the time a co-worker asked me to determine what the set of all points equidistant from a point and a line in 3 space is. Hours of work were lost (because you can't stop with a point and a line, no, you've got to do point-plane, line-plane, and then think about 4 space). All.... CPU Cycles... being... consumed ... Must... resist... attractive... problem...

    Plus, now Slashdot is simply going to lose everybody who makes quality posts. They'll be too busy writing their own java apps for "programmer's mineswepper" (no I'm not going to give you the URL). Slashdot will become a banal wasteland of first posts, trolls, and karma whores....

    (oh, wait...)

    --
    Libertarianism is rich wolves and poor sheep playing gambler's ruin for dinner.
  101. Re:NO! Don't Post The author's webpage... please.. by weston · · Score: 2

    Huh?

    Not so, unless I'm missing something. Take, for example, the 2-space equivalent of what he's talking about: the set of all points equidistant from a line and a point. This is a parabola. A point and a line qualify as subspaces of a plane, but a parabola ain't a single point (ever, I think).

    In three space, the point-line thing becomes a parabolic cylinder, and so does the line-plane (I think). The point-plane is a parabolic dish, like you'd use for a satellite receiver. Four space... sigh. No idea.

  102. Birds on a wire by anacron · · Score: 2

    I thought of a similar problem recently while driving along. There was a bunch of birds sitting on a telephone wire. It was pretty much a whole flock. A new bird would come along and sit on the wire, and if there wasn't room where he wanted to sit, he sat anyway -- the birds around him would shift appropriately, but it all happened so well.

    Extrapolate: Take the birds on a wire problem and turn it into a sorting problem. Given n things, put them in order. The problem with comptuters is that everything is digital. It wouldn't be possible to move the elements of a semi-sorted list down a little -- you always have to shift them by some number of spaces.

    I think the NP problem could be more easily solved if there was some analog way to do things like sort a list. Think of it ... you want to put something in a particular location, you just place it there, and the "things" around it shift a little

    The birds on the wire closest to the new bird have to shift the most .. the birds on the end of the wire don't have to shift at all. I want to be able to sort lists the same way --- it'd be much faster. Sure there's a physical limit to the number of birds that can be on the wire ... but remember that they can overlap a bit.

    There's an idea. An analog memory system that allows for overlaps of data points without data corruption. Build me that and I'll solve your NP vs P problem.

    anacron.

    1. Re:Birds on a wire by johnathan · · Score: 1

      The birds on the wire closest to the new bird have to shift the most .. the birds on the end of the wire don't have to shift at all. I want to be able to sort lists the same way --- it'd be much faster.


      I'm not sure what you're getting at. It couldn't speed up sorting in a very meaningful way. In a comparison-based model (which must be used for general sorting, barring assumptions such as integer keys within a known range or a known distribution of keys), it is easy to see that Omega(n lg n) comparisons must be made. [Warning--elementary algorithms ahead] This is by a simple decision tree argument -- each comparison has two possible results (< or >=), and there are n! permutations of the input, each of which could be the sorted order. With a branching factor of 2 and n! leaves, the height of the decision tree must be at least lg n^n = n lg n. So some path to a leaf must require at least n lg n comparisons. Thus, comparison-based sorting must take Omega(n lg n) time, independent of the strategy of moving keys around in memory. Even if nothing was ever moved in memory, but the algorithm only identified the correct permutation, it would still take Omega(n lg n) time. An intelligent data structure or memory model could speed up the run time by some additive amount asymptotically less than (n lg n) or reduce the constants hidden by asymptotic notation, but this does not affect the asymptotic run time.


      On the other hand, there is some parallelism in the situation you describe -- each bird is determining whether it should move (and moving) simultaneously. If we can perform more than one comparison per time step, then clearly we can sort in o(n lg n) time. But I don't think this is really what you were getting at, and parallel computing is not a novel concept.

      --

      --
      You don't need a weatherman to know which way the wind blows.
  103. Re:Do I get a million dollars? by goldfish · · Score: 1

    int known[][];
    int fuzz[][];

    for (y = 0; y Y; y++) {
    for (x = 0; x X; x++) {
    if (board[x][y] == MINE) {
    known[x - 1][y]++;
    /* repeat for other edges */
    } else if (board[x][y] == COVERED) {
    fuzz[edg][es]++;
    }
    }
    }

    now another n^2 loop to verify board[x][y] is between known[x][y] and known[x][y]+fuzz[x][y]

    if so, board is consistent, if not, board is inconsistent. O(n^2).

    That's not the whole problem, because that solution is far too easy. The fuzz[][] array is not entirely correct, since it would be possible to have:

    XX10
    2#20
    0000

    which is obviously NOT consistent, but would fuzz to be so with the above code. It would be another n^2 loop to determine that unknown is not a mine, but there would be cases where you couldn't establish it so easily, I'm sure, I just can't think of one right now.

    A probablistic solution would be pretty simple, though.

    --
    bje

  104. Travelling salesman problem, again by Animats · · Score: 2
    There is a large class of problems which require exponential time to solve optimally in the worst case, but can be solved near-optimally for most cases in far less time. Linear programming is one such problem, and the TSP is another. There was a lot of hype about neural nets solving the TSP rapidly back in the mid 1980s, and it was bogus.

    As a practical matter, solving the TSP is really easy.

    • 1. Link all the nodes into some random order.
    • 2. Pick two different links at random, cutting the chain into three chains.
    • 3. Try all the possible ways the three chains can be reassembled. Keep the one with the shortest distance.
    • 4. Repeat steps 2..3 until no improvement has been observed for a while.
    This algorithm was developed at Bell Labs in the 1960s. It usually converges on the optimal solution quite quickly. Since the discovery of that algorithm, other semi-random algorithms have been discovered for related problems. This has made a big dent in some useful classes of tough problems.
  105. That's a fast monkey by stubob · · Score: 1

    Ha, that will be a funny subject to see the next time I comment.

    Without doing any more calculations, don't forget a 1000 bit number is really huge and you've got to basically factor against all 32 bit integers (2^32 * 2^32 = 2^1000ish). The problem with factoring problems is no matter how fast you search, you will reach your asymtote(sp?) where you just don't want to wait any more. This is because, even with a perfect brute force algorithm, you've still got to check on average 1 in 17 numbers. Once you get a good sized key, that's a LOT of computations.

    Tell you what, give me a 40 bit key and a 56 bit key and I'll give you the pieces and the runtimes as proof by example.

    --
    Planning to be moderated ± 1: Bad Pun.
  106. Cease and Decist! by NightHwk · · Score: 1
    This research is a clear violation of the DMCA, in so far that it attempts to provide a way of nullifying reverse engineer protection of data!

    Do not support these criminals!

    NightHawk

    Tyranny =Gov. choosing how much power to give the People.

    --

  107. Winning at Minesweeper. by Michael+Jennings · · Score: 1


    It is possible to win at Minesweeper by defining and solving sets of simultaneous linear binary equations.

  108. Ender's Game by LS · · Score: 1

    Like the space war "simulation" in Ender's game, minesweeper is really just a distributed decryption tool... it makes all the unproductive workers productive!

    --
    There is a fine line between being a cultivated citizen and being someone else's crop. - A. J. Patrick Liszkie
  109. Do I get a million dollars? by RaveX · · Score: 3

    This is fundamentally insolvable.

    Consider a game board of any size, but in the upper-left hand corner, there sit four boxes:

    [][]
    [][]

    If row 1, column 2; row 2 column 1; and row 2, column 2 are all mines, the four boxes look like this:

    []##
    ####

    No data is known about row 1, column 1. Therefore, 2 possible solutions exist.

    Extrapolate this, assuming similar situations on a game board consisting of billions of rows and columns, and an astronomical number of possible solutions begin to emerge.

    Which, of course, is the whole problem with encryption. There are just too many possible answers (depending on key strength, etc).

    In short, yes, maybe minesweeper does have something to do with encryption. However, it won't be offering solutions any time soon.

    --M McCormick, Northwestern University
    ---sig---

    1. Re:Do I get a million dollars? by puppetluva · · Score: 1

      no, I don't think you get the money. . . your board is too simple.

      Try this:

      2#1
      ##2
      2#X

      #=Covered (unclear if a mine or not)
      X=Mine

      I think that this is more in the spirit of the problem. You would have to start guessing at which of the #s were mines. There doesn't
      seem to be a polynomial way to solve this
      problem (because of the guessing requirement, you can't be sure of the number of iterations you will need to ensure consistency).

      Note: The person clearly hasn't won the game: but that is not the problem here.
      p

    2. Re:Do I get a million dollars? by puppetluva · · Score: 1

      Actually, A better board would be this one:

      2#1
      ##2
      2#0

      p

  110. Top score by dmatos · · Score: 1

    I think I broke through the 120 barrier. IIRC, my best is 114. God knows how I did it though. I think it happened at about 2:30 in the morning, and my eyes had dried out. Since I was unable to blink, there was a greater percentage of the time that I was looking at the board.

    I think I remember a competition on my floor in residence where the best time was 97. No telling if that was without cheating though...

    --

    It may look like I'm doing nothing, but I'm actively waiting for my problems to go away.
    --Scott Adams
  111. fun with minesweeper by e_lehman · · Score: 4

    When I was an undergraduate, I wrote a program that would detect whether a particular move in Minesweeper was safe. It used a recursive search, and couldn't detect safe moves in certain late-game situations where the mine count was relevant, but its play was otherwise perfect.

    Since the program could definitively tell whether or not a move was safe, it could detect when a player was *GUESSING*. And so we could hack the program to always reveal a mine in such cases, driving the game weenies insane. :-)

    Okay, we never built the search into the game, but we did hack Tetris in a few irritating ways... (As I understand it, Tetris is a lost game anyway: with probability 1, if you play long enough, you will lose, no matter your speed or strategy.)

    1. Re:fun with minesweeper by rark · · Score: 1

      I assume you only did this a few moves into the game -- because the first few moves *must* be guessing (since faced with a field of unknowns, or mostly unknowns and one '1' block, one doesn't have enough data to make even an educated guess)

  112. Re:Weird by piku · · Score: 1

    Well if it doesnt let you hit a mine the first time there is a chance that you could solve the game without even uncovering a block.

  113. Re:Programming... by Surt · · Score: 2

    If you read the details, you don't have to solve minesweeper, you have to be able to check if the board is self consistent or not.

    Ie:

    2 MINE
    MINE BLANK

    is a self consistent board while:

    2 BLANK
    BLANK BLANK

    is not.

    --
    "Who is the Journal of Quantum Physics going to believe?" --Stephen Hawking
  114. Either this is too easy or I don't get it by multimed · · Score: 1
    I read the article (unlike some people) but I'm still a little confused.

    I'm imaginging writing a program to win minesweeper--the rules to play by are fairly clear (how to tell if certain squares are bombs not). The a program could very easily play by the same rules I do--only much much faster. And as some people have stated, no matter how good you are there are certain times where you are required to make a guess--again something a computer can do quickly. So I can very easily comprehend writing a program that in a fraction of seconds either wins or loses--if it loses, it plays again until it wins. I'm a pretty weak programmer and I think I could create such a program.

    But this is basically just a rework and (slight) refinement of the brute force methods.

    The problem in this is that in encryption, there is no indication of how close you are--like the numbers 1-8 indicate in minsweep. Is this what they're talking about and are looking for, uncovering some indication about quicker paths to take and eliminate unnecessary steps (like when a square has a 1 and you already know for certain of 1 bomb touching it so you can very quickly click all of the other open squares around the 1 square). This I what I don't get--how the encryption will provide any sort of feedback as to likely directions to go. And if it does, it seems like it would require a flaw of some sort.

    --
    Vote Quimby.
    1. Re:Either this is too easy or I don't get it by dstone · · Score: 1

      You would have to be able to do it 100% of the time without losing ever.

      I don't think that's the problem being posed. Because clearly, there is no way to "do it 100% of the time." Regardless of the algorithm you use for the 2nd and subsequent turns, your very first turn is based on zero information and it's going to be the luck of the draw whether you hit a mine.

      A long-term, multi-game strategy may maximize gains, but walking up to the table to win any single game cannot be done with certainty. So can someone tell me in more layperson terms what the real problem they're asking us to solve is?

    2. Re:Either this is too easy or I don't get it by piku · · Score: 1

      I think the problem is though that sometimes you will lose. You would have to be able to do it 100% of the time without losing ever.

    3. Re:Either this is too easy or I don't get it by Ozzy · · Score: 1

      The problem they are asking you to solve is the Minsweeper Consistancy Problem. The problem is determining which boards are consistent with the rules... ie. a 3 with no mines around it would be inconsistent.

      This is a hell of an algorithm when you really ponder it...

      --
      Remove the NOSPAM to spam me...
    4. Re:Either this is too easy or I don't get it by fifirebel · · Score: 2

      Uh, why would it be NP ?

      The complexity of checking a board of x columns by y rows is 8*x*y (8 because you need to check the 8 adjacent positions for every position). And I can see some algorithms faster than that by using rolling sums...

      Or am I missing something here ?

  115. Programming... by Fervent · · Score: 2
    So, write a program that can decode Minesweeper for any size board, and you will join the pantheon of mathematical greats, alongside Euler and Pythagoras.

    And, of course, there is that million-dollar prize. One question, though: wouldn't this be as simple as modifying basic human behavior? Would the first square be random (the only real option you have)? From there, solving the game is relatively easy, and a computer would be able to do it in a heartbeat.

    --

    - I don't care if they globalize against free speech. All my best free thoughts are done in my head.

  116. Important mathmatical caveat by kfg · · Score: 3

    Please note that if a solution to the minesweeper problem IS found that it demonstrates only that SOME solution will can be found for all NP problems.

    It will not only NOT mean that the solution to all NP problems has been found, but it will NOT mean that a solution to any * particular* NP problem, other than minesweeper, has been found.

    It will simply mean that a solution to any NP problem is * theortically findable.*

    Finding the solutions to an *actual* NP problem is left as an exercise to the student, or FBI.

    If NP problems do, in fact, prove to be solvable it will have an enormous impact on mainstream encryption of data transmission because such depends on having a *single,* or at least very small group, of encryption methods shared jointly by all.

    Crack it once and you're into the whole system.

    That be bad.

    For the 'nefarious' types it won't have much impact at all, because such will be using multiple layers of multiple encryption techniques. The encrypted data will itself be hidden in non obvious places, like embeded in a minor .gif on a website or embeded in something as inocuous as a laundry list, and when decoded will be in 'code' anyway, such as " The eagle flies at midnight,' for which an actual key code is inherently neccessary.

    To sum up, if the NP problem is solvable electronic money transfers and your e-mail are inherently insecure, but terrorists, at least the smart ones, still will be.

    That won't stop the FBI from playing the terrorist card to snoop YOUR e-mail though.

    1. Re:Important mathmatical caveat by Surt · · Score: 2

      Actually, a large set of NP problems become immediately solvable, because people have developed linear time translations between the problems. So if you can solve minesweeper consistency, you can just translate whichever NP problem you are interested in into minesweeper consistency (very fast) and then solve minesweeper consistency, and translate the solution back.

      --
      "Who is the Journal of Quantum Physics going to believe?" --Stephen Hawking
  117. Re:What if your first guess is a mine? by Surt · · Score: 1

    The problem is not solving minesweeper, it is checking the board for consistency, see some of my comments elsewhere.

    --
    "Who is the Journal of Quantum Physics going to believe?" --Stephen Hawking
  118. Actually, that's not the point. by composer777 · · Score: 1

    Actually, that's not the point. The problem is that your algorithm is recursive and scales very poorly. The point of the article was to find a way to solve NP problems in a a way that's similar to P problems. In order to solve the problem the way you are doing it, the computer has to brute force it, by looking at ALL the data. The challenge is to find a way to do it that doesn't involve traversing every path, which hasn't been solved yet, but will need to be solved yet. Many algorithms, are brute forcing things, and will fail to scale. Some examples are designing the fastest route through the internet so that traffic can be routed in the quickest way possible. Using the brute force approach of testing all possible paths, will not scale, and will eventually slow things such as the internet to a crawl as the number of paths increases.

  119. off topic, your user number... by colmore · · Score: 1

    have you considered the possibility that you might be the antichrist? you should be worried.

    --
    In Capitalist America, bank robs you!
    1. Re:off topic, your user number... by Syllepsis · · Score: 1

      Have you considered the possibility that your number might be worth something on ebay as well?

  120. Perhaps this is where quantum computing... by Necrotica · · Score: 1

    ...comes into play?

  121. How factoring is not NP complete but O(n^0.5) by yerricde · · Score: 1

    NP means that a solution to a problem can be checked in polynomial time, making it possible to bruteforce the solution. NP complete means that there is no deterministic algorithm to find such solution in polynomial time. Factoring numbers is approximately O(n^0.5) divides; simply divide the number n that you want to factor by all primes less than or equal to sqrt(n).

    --
    Will I retire or break 10K?
  122. gnomine by bendawg · · Score: 1

    Or for those of us who are linux-heads, the answer can be found in gnomine (gnome) or kmines (kde).

  123. Minesweeper and Encryption? by ptbrown · · Score: 2

    So.... does this mean all I have to do to break any encryption is type "XYZZY"?

    --
    Any sufficiently advanced civilization is indistinguishable from Gods.
  124. Re:Proving P=NP does not make breaking codes easie by nuttyprofessor · · Score: 1

    Actually, even if the exponent is large, it gives
    us hope. I think you fail to see the difference
    between exponential functions and large degree
    polynomials. Given many processors, we can break
    an O(x^n) into an O(x^k) problem where k n.
    Parallel programming doesn't really help at
    all for exponential problems.

    In a nutshell, using many parallel processors,
    we can lesson the degree of O(x^n) algos.
    No hope of this for O(2^x) algos.

    --wayne

  125. Good, simple description of the problem. by dstone · · Score: 1

    Aha. That's a good, simple problem description... given a board where each square has either a number or a bomb in it, verify its consistency. Nothing to do with playing or solving the game itself. Thanks, rasbora.

  126. See for yourself! (was It is possible...) by Anonymous Coward · · Score: 1

    Hey! Rather than fighting back and forth on this issue why don't you all try downloading my contribution! :-) I wrote an implementation of minesweeper that plays itself and tells you if you have to guess or not. You need GTK+ 1.2.3 (or later) and a thread library. Get it at mindsweeper.tgz By the way: testing 1 million 30x16 games with 100 mines shows that 87.12% of all games require you to guess. So "NO", you cannot always solve minesweeper... not even close.

  127. What if your first guess is a mine? by dmorin · · Score: 2
    Ummm...I confused. Say there is 1 mine hidden on a 10x10 grid. To start I have absolutely zero information about where that mine is. Therefore I must guess at the location. Therefore, 1/100th of the time, I will be wrong on the first guess. Therefore it is impossible to "solve" the game, because you cannot say "You will always win if you start by making move x..." See what I mean? For any "solution" you provide, couldn't I in theory hit a mine on my first attempt and thus not win?

    Isn't it? What am I missing?

  128. Dumb question by epukinsk · · Score: 2

    Dumb question, but couldn't a really, really, really fast monkey with a calculator theoretically take a 1000 bit number and start at 1 and work his way up, checking if each is a factor? If he was fast enough, he could do it in a second.

    -Erik

  129. I have the solution by agentZ · · Score: 1

    I have discovered an amazing solution to the Minesweeper P=NP problem which unfortunately will not fit into this margin, but I am willing to accept venture captial in the meantime.

  130. the real secret to minesweeper? by ardiri · · Score: 1

    maybe the real secret to running windows successfully is being able to locate all those "trouble" areas just like you can find those "bombs" in the game. i guess, one could also say they are similar, throw everything you can at windows (like clicking randomly in minesweeper) and sooner or later... the games over. reboot.

  131. I love this shit by Dungeon+Dweller · · Score: 1

    Nice theory, no details, so I have a pretty good idea of what they are talking about. You analyze the numbers and use the patterns that numbers form to seek similar patterns in foward moves. Of course, the article makes it sound a lot dumber than that...

    --
    Eh...
  132. Re:Weird by Tentac · · Score: 1

    Not quite true, since Minesweeper will simply not allow you to click on a mine on your first attempt. It'll highlight the square when you click on it but it'll refuse to uncover it.

    In MS Minesweeper it works like this: if you hit a mine on your first click that mine is moved to the top left square, and if that one is occupied it ends up in the square to the right of it and so on. (this is actually good to know when you get a situation where you have to make a guess up in that corner ;)

  133. did anybody read the Sci.American article? by EatAtJoes · · Score: 2

    They described (with pictures) how this Minesweeper thing works, something about OR gates ... possible and impossible configurations ... much more informative than boston.com's article. However, I don't have the magazine ...

  134. What? by gadge47 · · Score: 1

    Umm. Last I checked, factoring co-primes was not NP. Can anyone else back me up on that?

  135. n^0.5 by cameldrv · · Score: 1

    Well, if you measure N in terms of the magnitude of the number, it's polynomial. However when people say factoring is NP, they mean that it is NP in the number of digits.

  136. Did anyone not notice... by CaptainAlbert · · Score: 1

    ...that Peter Schor came up with a quantum computing algorithm which factors large numbers in polynomial time, back in *1994*? For that reason, RSA encryption should be looked upon as insecure if being used to protect data for more than, say, five years. As soon as they build a quantum computer, RSA is effectively worthless. Sure it would be nice to have a P-class algorithm to run on a regular computer too, but that's beside the point if the cat is already effectively out of the bag. (For those suggesting that very very fast massively parallel computers can be used to factor v. large numbers, remember that adding a single decimal digit to the key increases the computational effort required to factor it by orders of magnitude.)

    --
    These sigs are more interesting tha
  137. Weird by graveyhead · · Score: 2

    The first square chosen MUST be random. There are no clues as to what may lie under the first square clicked. This implies that there is always *some* chance that even an otherwise perfect algorythm may fail.

    IMHO this implies that the analogy of minesweeper to P vs NP is a very good choice.

    --
    std::disclaimer<std::legalese> sig=new std::disclaimer; sig->dump(); delete sig;
    1. Re:Weird by graveyhead · · Score: 2

      damn that should have read "...the analogy of minesweeper to P vs NP is a *not* very good choice."

      Sorry 'bout that.

      --
      std::disclaimer<std::legalese> sig=new std::disclaimer; sig->dump(); delete sig;
  138. Now Minesweeper is a legitimate network tool! by unDees · · Score: 3
    Just think--MCSE certification will finally be worth something ("SSL? What's that? I just know I click on the little happy face icon and get a brand new life.").

    And those who get caught screwing around on company time can tell their bosses, "I was just evaluating our encryption strategy."

    --
    "I call a baby goat a 'goatse.'" -- my non-Internet-savvy 6-year-old stepdaughter
  139. render encryption useless? by Anonymous Coward · · Score: 1

    The point of P/NP in crypto is that certain problems (such as the knapsack, or factoring large numbers, and such) are not proveably harder than other problems. Proving that P = NP would mean that there is a solution to the knapsack, and factoring large numbers, and so on, that is not demonstrably harder than solutions to much simpler problems. But it won't tell you what those solutions are. People have been searching for solutions to these NP (hard) problems for a long time... the fact that the solutions might make the problem quicker to solve doesn't make the solution any easier to find.

    1. Re:render encryption useless? by baxissimo · · Score: 1
      Ah yes, but every NP-completeness proof (except for Church's first proof) is based on transforming one problem into another. I.e. you prove it by saying I don't know if problem X is NP complete, but if I could solve X, then I could solve Y which I know is NP-complete. Therefore X must be NP-complete as well, because it's as least as hard to solve as Y. So the NP completeness proofs, of which there are MANY, all form a tree and at the root of the tree is Church's original proof of the NP completeness of satisfiability. Church did the difficult proof for us already. He proved that if you can solve satisfiability, then you can solve ANY NP-complete problem. That completes the loop.

      So you are right, a proof that P=NP doesn't necessarily tell you how to solve any NP-complete problems in polynomial time, BUT all you need is to be able to solve one, and then you work your way down the tree to satisfiability, from which point you can solve any NP-complete problem.

  140. What you really need to do... by Lozzer · · Score: 1

    The NP problem is:

    Given a grid of numbers determine whether the grid could form a valid minesweeper board.

    Its easier to think of the problem as supplying a set of mines that are consistent with the given layout. This makes the P algorithm for checking a solution:

    Is the board for this set of mines the same as the board under test?

    --
    Special Relativity: The person in the other queue thinks yours is moving faster.
    1. Re:What you really need to do... by Lozzer · · Score: 1

      What they didn't mention is how you measure the size of the input - is it the average length of a side, or is it the total number of cells (I think this would make a difference but its been a while since college...)

      --
      Special Relativity: The person in the other queue thinks yours is moving faster.
  141. Re:Not really - let me explain by OnanTheBarbarian · · Score: 1

    Actually, I've heard of theorists working to prove that P=NP is unprovable (given a particular framework for proof). That was years ago, and I haven't seen anyone beating down their door to hand out awards, so I can only assume that these attempts have been a futile as attempts to decide the actual problem.

    Anyone know what's going on with this kind of work these days?

  142. Re:fun with xtetris by Venebulon · · Score: 1

    When I was completing my honours year in Computer Science, the undergraduates spent a lot of time playing a multiplayer unix tetris game, where your own tetris board was displayed alongside that of the other players. If you made two or more rows at once, all the other players received a row of garbage blocks on top of their current boards.
    Some of the other post-grads got the client source, and made a bot-player that would play for half a minute, then flood the other players, reporting that it had made lots of multiple rows.
    Another time we made a hacked client that always gave the long skinny tetris peice whenever there was a need for one, and you could press a key to change the falling shape to another peice.
    Thought we might get the sysadmin dudes irate for "hacking" a program on the system, but were actually encouraged to disrupt any undergrads wasting time (and spare terminals) in the computer labs.

    --
    Why is the universe here? -Well, where else would it be?
  143. I have a solution. by bob4u2c · · Score: 1
    "So, write a program that can decode Minesweeper for any size board, and you will join the pantheon of mathematical greats, alongside Euler and Pythagoras.

    And, of course, there is that million-dollar prize."


    Simple, either reverse engineer minesweeper or buy the source code from the creator. Then write a program that searches for a running copy of minesweeper. Have it look at the memory the game is using, find the representation of the game grid and extract the locations of the mines. If coded right it will work everytime.

    Ok, this is probably considered cheating but for a cool $1,000,000 it might be worth it!
  144. Not really - let me explain by xonix7 · · Score: 4

    The simple truth of the problem is that there is no one answer to it...

    Not many people have a firm grasp of what this problem is really all about. Sure, you'll study it in your B.Sc or B.Tech...but really, even graduates fail to grasp some key concepts, although they study the tougher concepts....basically, this is how it goes:

    P is the set of problems that can be solved in deterministic polynomial time. That means for a problem with inputs of size N, there must be some way to solve the problem in F(N) steps for some polynomial F. F can be any polynomial, even N to the 10 millionth power.

    NP is the set of problems you can solve in non-deterministic polynomial time. That means for a problem with inputs of size N, there must be some way to solve the problem in F(N) steps for some polynomial F just as before. In NP, however, the student is allowed to make lucky guesses, though it must prove the solution is correct. The standard format for a program in NP is: Guess the answer. Verify that the answer is correct in polynomial time. For example, factoring is in NP. Suppose you have a number A that you want to break into two factors. The NP program is: Guess factors P and Q. Multiply P times Q and verify that the results is A. This takes only two non-deterministic steps so the problem is in NP. Therefore, considering the differences between the two and the estimation involved, how is it possible to prove something like this?

    You can't "prove this". You can't disprove it either, but that's not the point - minesweeper is not going to help you with this.

    --
    Everything is but a number spoken by itself.
  145. Stay Away by Syllepsis · · Score: 1
    Anyone know what's going on with this kind of work these days?

    Yea, this is the problem they tell young researchers not to delve into. It is the Grendel of Mathematics, a lurking monster that crushes GAs in its jaws. Whenever you work on NP problems, never think about proving NP!=P or P=NP. Don't even consider trying to prove that it is unprovable. Stay away from this kind of thinking. Go study something harmless, like Godel's proof. Havent You People Seen PI???

  146. New geek insult for the slower minds by billcopc · · Score: 1

    So now I can walk up to people who don't grok minesweeper and say "Your NP matrix sucks".

    Expect alot of dumb looks.

    --
    -Billco, Fnarg.com
  147. Proving P=NP does not make breaking codes easier by VSarkiss · · Score: 4
    Proving the conjecture false would mean that modern encryption technology, the foundation of electronic commerce, would be open to easy attack.

    Wrong. It would do nothing of the kind. Proving Riemann's Zeta hypothesis would do that.

    Even if you proved prime factorization of large numbers can be done in polynomial time, you would need an algorithm that accomplished it in a reasonable amount of time (seconds). An algorithm that had time complexity O(n^100) would still be polynomial, but useless in practice.

  148. What about this? by winter@ES · · Score: 1
    --

    Paul Bettner

    Game Developer et al