Using Hilbert Curves to 100% Zelda
blog.merovius.de
blog.merovius.de
Many databases nowadays contain functions to these operations (e.g. https://dev.mysql.com/doc/refman/5.7/en/spatial-analysis-fun...)
TSP is actually very amenable to heuristics and state of the art branch-and-bound algorithms can often find optimal solutions even for instances with thousands of points.
Does anyone here know if there is a good open-source solver that we could throw this problem instance at?
I can't immediately think of a reduction that would factor this in so the best thing may be to just reduce this to the appropriate ILP instance and use a mixed ILP approximator like GLPK (or Gurobi is free for students too).
Incidentally, achieving a polynomially-sized ILP formulation for TSP isn't quite obvious. Wikipedia has a good explanation of how to do this: https://en.wikipedia.org/wiki/Travelling_salesman_problem#In.... I'm not sure if the metric TSP has a simpler formulation.
Edit: Now that I think about it, it may be difficult to express the constraint that edges should be balanced out in a linear way. I happened to write about a similar problem a while ago (https://modalduality.org/posts/optimizing-color-coding/), I ended up giving up on finding a linear formulation and went for sequential least squares instead.
I am saying you may map K1 as √((x1-x2)^2+(y1-y2)^2) to find least distance, but TSP allows for arbitrary constants. So remove the √ and long trips will be strongly avoided.
PS: As far as I know you can use any arbitrary set of constants then use a linear solver. Or am I forgetting about something?
You might make your weight function as w(d, p) = d * (2 ^ p)
Note that the licensing terms do restrict its free use to "academic research."
Then it is not "open source" (violates "No Discrimination Against Fields of Endeavor") nor is it free software (violates the freedom to use for any purpose). It's proprietary -- just because the source code is available doesn't make something "open source" nor does it make it free software.
In own research (inverse problems related to signal recovery), I've noticed that a lot of NP-hard problems are actually easily solvable given that the data has some kind of structure to it. I know very little about computational complexity theory, but I've read some papers describing how there is often a phase transition where a high SNR puts the problem in P territory, but a sufficiently low SNR moves the problem moves to NP territory (but it's still solvable). Beyond the phase transition, a solution is information theoretically impossible. I wonder if most of these real world TSP problems actually lie in P, but I don't know how one would go about showing that. (I haven't performed a literature search, but I wouldn't be surprised if someone has already demonstrated this.)
It would be, if you'd want to do a speedrun, though.
With that many points, how do you prove that your solution is optimal?
An easy example is by using duality when solving linear programs.
And sometimes your upper bound is close enough to what you already have so you can just say something like "well my solution gets 190 points, I have an upper bound of 190.5 points, and all point rewards are integral so I must have the optimal solution."
This is easy to understand with integer factorization: It is very hard to factor large integers. Yet, if I where to give you two numbers, it is very easy to verify that their product is the integer you where looking at. So factorization is easy to verify, but hard to do (side-note: This is an intentional illustrative simplification. Integer factorization is not known to actually be "hard" and it is not known whether "hard" is even a thing. See below).
And that's the definition of an NP problem: It has a polynomial time deterministic algorithm to verify a solution.
An NP-complete problem is a problem that is at least as hard as any NP problem. That is, if you have an algorithm for an NP-complete problem, you can take any NP problem, transform it efficiently into that problem, use your algorithm and transform the solution efficiently back. Thus, if you've solved an NP-complete problem efficiently, you can solve all NP problems efficiently. TSP is NP-complete. Whether or not Integer Factorization is NP-complete is unknown.
Lastly, there is the question of whether there are problems that are in NP (that is, have a polynomial algorithm to verify a solution) but not in P (that is, have a polynomial algorithm to find a solution). That's the famous P vs. NP question, which is currently undecided.
A French guy (Xalikah) who did the first, manually planned 100% speedrun of the game had a similar problem; he spent a few hours with a couple folks helping him check his map for obscure place names he was missing, and when he was at the last one, someone joked "99.81% speedrun," and people were suggesting he do a slow systematic scroll over the map so they could look for missing placenames. He wound up sleeping five hours or so and in the morning remembered that he'd skipped using some bridge somewhere. 49 hours!
It's kinda wild that game worlds are now large enough that you can reasonably use algorithms not only to write games but to get 100% completion playing them as well.
I haven't played Breath of the Wild yet, but eg Chrono Trigger has an enormous game world as well. Did they really get much bigger since?
And durian. Delicious, delicious durian.
Is the world planar? There's an epsilon approximation scheme for planar TSP that's linear in the graph size (but exponential in 1/ε)
So in a speed running context, I would definitely say it is acceptable, but it might not be in the greater population. But the grammar nazi have nothing on this one.
Many games, including the one in question, have an in-game progress tracker. To "100%" the game is to complete everything necessary to make it reach 100%.
For games without such a tracker, the community usually reaches a consensus on what is considered to be 100%.
(yes, I'm being toung-in-cheek by using "English" as a verb here :) )
1...2...3...4...5
7...............6
8.......9........
13..12.....11..10
versus 1...2...3...4...5
13..............6
12......9........
11..10......8...7http://www.texample.net/media/tikz/examples/PNG/hilbert-curv...
This might lead to say
. . . . . . . .
1 . . . . . . 2
4 . . . . . . 3
. . . . . . . .
when
. . . . . . . .
1 . . . . . . 4
2 . . . . . . 3
. . . . . . . .
is more efficient.
Generally speaking, it seems this is basically TSP.
You can even see that in the argument I added to the post; while a zig-zag line might've been, in theory, a stupider, easier way to solve the problem, in practice it would've meant spending some time thinking about the right discretization. With a Hilbert-curve, I could just choose some n that is definitely large enough and be done with it and the additional cost of the more complicated curve doesn't really factor in, as I could just copy-paste it anyway.
But yes. The theoretical problem is a TSP and with the right set of tools, I could've added some efficiency to the search by viewing it as such.
/**/jQuery3110644358575
2152035_1500757689075(
/* json-data */)
Is that just JSONP?Also, I still consider JSONP an incredibly gross idea :)
Elevation and the like would be more interesting to figure out what's the most efficient way to collect all Korok Seeds, for example, when the interesting point cloud isn't as sparse. But then you'd definitely want to view it as a TSP problem anyway.