
TrackMania is NP-complete - hiq
https://arxiv.org/abs/1411.5765
======
garethrees
The proof is not quite complete — the paper says, "given a path in the track
we can check in polynomial time whether it completes the track." But this is
only true if the path has length that's polynomial in the length of the track.
So there needs to be an argument showing that if there is _any_ solution to a
TrackMania level, then there is one that's polynomial in the length of the
track.

I think this is straightforward in the case of TrackMania but it needs to be
spelled out. In other motion-planning games — for example, Sokoban — there can
be levels that require an exponential number of moves.

A quick sketch of how you might argue it. There are polynomially many states
for the position, heading, velocity and other attributes of the car. Although
there are exponentially many states for the n checkpoints, any given run can
only visit n of them (because the checkpoints cannot be reset). Hence any
given path can visit at most polynomially many different states, and so for
every path there's a path of polynomial length that reaches the same end state
(just cut out the portions of the path between identical states). Hence if
there's any path that completes the level, there's a path of polynomial length
that does so.

------
CJefferson
This isn't deeply suprising, once you know that TrackMania can require the
user to go through a set of checkpoints _in any order_. This gives us a kind
of "memory" (which set of checkpoints we have already completed), which makes
NP-completeness proofs much simpler. It's still very cute, but would apply to
most racing games with that property (and the ability to force people through
paths which they cannot return through).

------
krallja
This paper would be much more entertaining with a complete example 3-SAT
solver track, and a twitch stream of people trying to complete it.

~~~
Sarkie
100%!

------
ikeboy
Similar examples:

[https://news.ycombinator.com/item?id=9022021](https://news.ycombinator.com/item?id=9022021)

[https://news.ycombinator.com/item?id=1315551](https://news.ycombinator.com/item?id=1315551)

[https://news.ycombinator.com/item?id=10317224](https://news.ycombinator.com/item?id=10317224)

[https://news.ycombinator.com/item?id=9645845](https://news.ycombinator.com/item?id=9645845)

[https://news.ycombinator.com/item?id=10574895](https://news.ycombinator.com/item?id=10574895)

[https://www.youtube.com/watch?v=HhGI-
GqAK9c](https://www.youtube.com/watch?v=HhGI-GqAK9c)

[https://bosker.wordpress.com/2013/03/13/adrift-is-np-
complet...](https://bosker.wordpress.com/2013/03/13/adrift-is-np-complete/)

[https://arxiv.org/abs/1106.2104](https://arxiv.org/abs/1106.2104)

[https://nadamhu.wordpress.com/2013/06/14/my-ios-game-
based-o...](https://nadamhu.wordpress.com/2013/06/14/my-ios-game-based-on-the-
maximum-clique-problem-find-the-mafia/)

[http://www.gwern.net/Turing-complete](http://www.gwern.net/Turing-complete)

[http://for.mat.bham.ac.uk/R.W.Kaye/minesw/ordmsw.htm](http://for.mat.bham.ac.uk/R.W.Kaye/minesw/ordmsw.htm)

(Generated by going through HN search results for Turing complete and NP
complete)

------
roundsquare
Is the following correct? This proof depends on the fact that in the clause
gadget (figure 5) the car can't turn once it jumps to the cheek point. Because
of this, it can't in from the track for one for one variable to that for
another.

~~~
garethrees
Yes, that's right.

The paper doesn't explain in detail how the gadgets are assembled. But
presumably the track is arranged so that from the starting point the car must
enter the variable gadget for X1. The "true" branch for X1 then visits each
clause gadget containing X1, and the false branch visits each clause gadget
containing ¬X1. These two branches must then come together somehow (no gadget
is given, but it's easy to see how to make one), and then enter the variable
gadget for X2, and so on.

So if the car could steer in mid-air, then it would be able to jump from ¬X3
(say) back to X1, and this would allow it to repeat the track for the X2 and
X3 variables, and it could make a different choice on the second run through,
thus making its path no longer correspond to a 3SAT solution.

~~~
roundsquare
Thanks, that's basically how I saw it. I guess that's one way how this proof
essentially makes the problem discrete (in addition to assuming perfect
driving).

------
cheapsteak
[https://arxiv.org/abs/1411.5765](https://arxiv.org/abs/1411.5765)

------
jjar
Site can't be accessed from here (Maybe overloaded with traffic?). Anyone got
an archive?

------
dilap
near figure 5, shouldn't the clause X1 ∧ ¬X3 ∧ X4 be X1 ∨ ¬X3 ∨ X4?

~~~
garethrees
Yes, that's right. 3SAT uses conjunctive normal form.

------
staticelf
What does "NP-complete" mean? Can anyone elaborate?

~~~
taneq
It's confusingly written. In this context, I think they're saying that there's
no general polynomial-time algorithm (edit: assuming P != NP, thanks
chengsun!) to give you a path through a TrackMania track which will complete
the track (as in, visit every waypoint in some order and then reach the
finish).

~~~
chengsun
This is only true assuming that P != NP, which is still an unsolved question.

Furthermore, NP-completeness only applies to decision problems. In this case
the paper explores the problem of deciding whether or not there exists a path
which will complete the track.

The upshot is, if there exists a polynomial-time algorithm to decide this
question, then we can use this algorithm to solve all other NP decision
problems in polynomial time.

~~~
taneq
Good catch, and it'd be hilarious if such a long-standing problem were solved
by some person trying to write a bot for a racing game.

