What is the connection between NP-Complete problems and this puzzle game?

-Job-
Science Advisor
Messages
1,152
Reaction score
4
There's a variety of NP-Complete problems like the Clique problem, the Hamiltonian cycle problem, Satisfiability, etc.
Recently i discovered a simple puzzle problem that is NP-Complete (the proof involves a straightforward reduction of the Clique problem).

Anyway, i built the actual puzzle game, using flash and i think it's cool because it illustrates the difficulty of solving NP-Complete problems and why, in all likelihood, P != NP.

http://www.bloo.us/blog/?blogger=4&pid=13

I'm thinking of putting together a site with NP-Complete puzzle games. :smile: I can think of a couple of others.
 
Last edited by a moderator:
Physics news on Phys.org
What is the reduction?
 
It's a simple reduction. Consider a graph of n nodes. The clique problem asks for the size of the biggest clique in the graph, that is, the largest subset of the n nodes with the property that every node in that subset is connected to every other node in that subset.

We can transform the clique problem into the "Grid" problem (that's what I'm calling it i guess) by making use of an n*n sized grid. For each box in the grid, at some position (x, y), let it be black if the x-th node in the graph is connected to the y-th node in the graph. We'll treat each node in the graph as if it were connected to itself, so that the box at position (k, k) is black.

It follows that a graph with a clique of size C will have a C*C sized square block of black boxes in its corresponding grid. Naturally, the block will only be immediatly visible if the nodes that form the clique are consecutive (for example, nodes 4, 5, 6 and 7). If the nodes are not consecutive then the block will be spread out through the grid, but you'll always be able to make it visible by reordering the rows and columns.
Hence, it follows that if you can create a C*C sized block of dark boxes on the grid, then the corresponding graph must have a clique of size C.
Thus, the problem of determining the size of the biggest clique within a graph reduces to the problem of determining the size of the biggest block that you can put together in the grid, by reordering the rows and columns.

This is a polynomial time reduction, O(n^2) steps, so a polynomial-time solution to the Grid problem implies a polynomial-time solution to the Clique problem, an NP-Complete problem. Hence the Grid problem is NP-Complete.
 
Last edited:
I've written a puzzle based on the NP complete problem of Boolean Formula Satisfiability (SAT3) at http://www.chronon.org/applets/sat.html , together with the option to automatically find a solution. What surprised me was how fast the algorithm is in most cases. Typically it takes 100 - 200 steps, a lot less than an exhaustive search of 2^26 steps.
 
Last edited:
That's cool. The most i saw was ~150 steps.
 
Namaste & G'day Postulate: A strongly-knit team wins on average over a less knit one Fundamentals: - Two teams face off with 4 players each - A polo team consists of players that each have assigned to them a measure of their ability (called a "Handicap" - 10 is highest, -2 lowest) I attempted to measure close-knitness of a team in terms of standard deviation (SD) of handicaps of the players. Failure: It turns out that, more often than, a team with a higher SD wins. In my language, that...
Hi all, I've been a roulette player for more than 10 years (although I took time off here and there) and it's only now that I'm trying to understand the physics of the game. Basically my strategy in roulette is to divide the wheel roughly into two halves (let's call them A and B). My theory is that in roulette there will invariably be variance. In other words, if A comes up 5 times in a row, B will be due to come up soon. However I have been proven wrong many times, and I have seen some...

Similar threads

Replies
7
Views
3K
Replies
7
Views
4K
Replies
1
Views
2K
Replies
1
Views
3K
Replies
5
Views
4K
Back
Top