News for hackers. Stuff that matters.
Re:A Solution of the P versus NP Problem? by zolthrowaway on Monday August 14, 2017 @01:38PM (#15010630)
The most interesting thing is if P=NP. If that's the case, that means that there is an algorithm that can solve any NP problem in polynomial time. This means that things like crypto would be able to be cracked in polynomial time which presents a huge problem for security.

We basically operate under the assumption that P!=NP currently. Validation that this is true doesn't really change much. I can't speak to how this may help a academic researcher in CompSci, but it probably doesn't change much for most programmers.

Re:A Solution of the P versus NP Problem? by vanjoe on Monday August 14, 2017 @02:55PM (#15011480)
I think it's even less useful, even if P = NP it is possible that no one finds an algorithm. Creating a (useful) algorithm is independent of proving the theorem. Also interesting is that someone could create an algorithm that solves NP complete in polynomial time without proving P=NP. They would be unable to prove the algorithm correct though.
Re:A Solution of the P versus NP Problem? by phkahler on Monday August 14, 2017 @03:29PM (#15011932)
>> even if P = NP it is possible that no one finds an algorithm.

If someone could prove P=NP but no one could find an algorithm. That would be incredibly funny in some sense. Like a huge joke played on us by the universe.

Re:A Solution of the P versus NP Problem? by MBlume on Monday August 14, 2017 @04:24PM (#15012513)
Alternately, a polynomial time algorithm is specified and the exponent is, say, 2500. Mathematically huge, practically useless.
Re:A Solution of the P versus NP Problem? by Gehinnn on Monday August 14, 2017 @07:34PM (#15014005)
Actually, we already know an algorithm that solves an NP complete problem in polynomial time iff P = NP. We can just enumerate all programs and ask them to generate witnesses. As we can decide whether a witness is valid and there is a program that always outputs a valid witness if P=NP, we can find that program within finite steps and the algorithm is correct.
Re:A Solution of the P versus NP Problem? by kevinwang on Monday August 14, 2017 @08:09PM (#15014231)
Correct me if I'm wrong, but enumerating all programs doesn't seem polytime
Re:A Solution of the P versus NP Problem? by mihaild on Monday August 14, 2017 @09:25PM (#15014597)
Formally, we run all possible programs in parallel: the 1st program runs for 1 step; the 1st and 2nd programs run for 1 additional step; programs 1-3 run for 1 additional step; ... After program stops, we check if its output is our witness. If there is program number K running in time f(n), then our program runs in time O(K * f^2(n) * [simulation time] * [check time]), which is polynomial if f is polynomial.
Re:A Solution of the P versus NP Problem? by mihaild on Monday August 14, 2017 @05:09PM (#15012928)
There is Universal Search algorithm. If P=NP, it finds a solution for solvable 3-SAT in polynomial time. (still not solving 3-SAT itself in case we will not be able to determine running time, but in cryptography AFAIK we usually need solutions for known-solvable instances)
Re:A Solution of the P versus NP Problem? by zolthrowaway on Monday August 14, 2017 @04:16PM (#15012428)
This is absolutely correct. Proving P=NP doesn't magically create the algorithm, it just proves that there is one.

However, the reason why I chose to single out crypto specifically is because it has the most to lose if that algorithm exists. Our current methods of encryption become unsafe regardless of whether the algorithm is known or not. I don't think you can claim that your encryption is secure if there is an algorithm that can crack it in polynomial time, regardless of whether the algorithm is known or not.

Re:A Solution of the P versus NP Problem? by petters on Tuesday August 15, 2017 @04:29AM (#15016433)
> Proving P=NP doesn't magically create the algorithm, it just proves that there is one.

This is 100% true for all practical purposes. But there is an explicit algorithm for NP-complete problems that runs in polynomial time iff P=NP. The Wikipedia page has it written down. https://en.m.wikipedia.org/wiki/P_versus_NP_problem

Re:A Solution of the P versus NP Problem? by 21 on Monday August 14, 2017 @03:16PM (#15011776)
It is my understanding that P = NP might have serious implications for quantum physics (ie, quantum physics suggests that P shouldn't be equal to NP).
Re:A Solution of the P versus NP Problem? by gus_massa on Monday August 14, 2017 @04:05PM (#15012328)
Nah. That "result" circulated a few years ago in the Internet, but it was mostly a mix of hand waving and hidden assumptions. It's not a mainstream result, and I doubt that it will be confirmed someday.

It's interesting because it mix two interesting topics, that are well known in the popular science forums, but are very technical and most people don't want to read all technical the details of both.

Relevant xkcd: https://xkcd.com/1240/

Re:A Solution of the P versus NP Problem? by DonbunEf7 on Monday August 14, 2017 @03:04PM (#15011600)
On your second point, a construction which transforms NP-complete problems into P problems in polynomial time necessarily implies P = NP, by construction. If the algorithm isn't correct, then it's a heuristic, not an algorithm, and we have piles of heuristics for working with NP-complete problems already.
Re:A Solution of the P versus NP Problem? by vanjoe on Monday August 14, 2017 @03:10PM (#15011685)
I'm pretty far out of my area of expertise, so I'll take your word for it. Could an an algorithm be correct, but not proven correct, or is it defined as a heuristic at that point?
Re:A Solution of the P versus NP Problem? by sethrin on Monday August 14, 2017 @04:15PM (#15012423)
Pretty much everything programmers do is create unproven algorithms. Hopefully at least some of them are correct. A heuristic is a problem-solving approach that has a chance of failure. So say you need a pretty fast dictionary, and you can take a relaxed attitude to correctness. You can take a hash of the words of your dictionary, and then as you are filtering some dataset, you can always say in a short time whether a value is definitely not in your dictionary, but your positive solutions have a percent chance of being incorrect (e.g. a hash collision). The idea is generally to make a problem tractable that would otherwise be computationally difficult or impossible. I'm not sure if that quite answers your question.
Re:A Solution of the P versus NP Problem? by Chinjut on Monday August 14, 2017 @04:11PM (#15012383)
An algorithm could certainly be correct (in the sense of always giving the correct result) without being proven to do so (or even without any such proof existing, in some particular formal system). You are not wrong about that.
Re:A Solution of the P versus NP Problem? by hood_syntax on Monday August 14, 2017 @04:05PM (#15012324)
Godel's incompleteness theorem would seem to imply that is possible unless I'm misinterpreting it. I have a rather elementary understanding.
Re:A Solution of the P versus NP Problem? by adam-fn on Tuesday August 15, 2017 @05:14AM (#15016607)
The Collatz conjecture ( https://xkcd.com/710/ ) may well be an example here.
Re:A Solution of the P versus NP Problem? by Sharlin on Monday August 14, 2017 @05:13PM (#15012969)
If P=NP, then finding an algorithm is, by certain definition, exactly as easy as proving an algorithm correct! This is, after all, the gist of what P vs NP means. And this is why it's such a huge deal - the problem is almost self-referential in nature.
Re:A Solution of the P versus NP Problem? by anarazel on Monday August 14, 2017 @05:24PM (#15013066)
> This is, after all, the gist of what P vs NP means. And this is why it's such a huge deal - the problem is almost self-referential in nature.

Could you back that up with some citations? This doesn't ring true. But my pure CS has withered a bit...

Re:A Solution of the P versus NP Problem? by mihaild on Monday August 14, 2017 @05:43PM (#15013262)
For example, algorithm that just copies it's input to output, unless input is proof of inconsistency of arithmetic, is correct algorithm to calculate function f(x) = x - yet it's unprovable in PA that it's correct.
Re:A Solution of the P versus NP Problem? by natehouk on Monday August 14, 2017 @06:13PM (#15013495)
This is correct. And, in fact, P=NP.

However, while P=NP, the algorithm (oracle) resides on the other side of the event horizon. This is called the MAD paradox.

https://nerdynotmad.com/p-equals-np/

The submitted proof will be found to be incorrect.

Re:A Solution of the P versus NP Problem? by openasocket on Monday August 14, 2017 @07:08PM (#15013845)
I haven't the foggiest idea what that "proof" is supposed to mean, I can't follow any step in it. What is MAD in this context?
Re:A Solution of the P versus NP Problem? by legulere on Monday August 14, 2017 @07:19PM (#15013905)
Would it present a problem for cryptography though? Quadratic algorithms are seen as already slow, cubic algorithms as unbearable garbage you best try to avoid if your data size is not tiny. And this completely ignores constant factors that can play a big role. Homomorphic encryption for instance fails to be usable just on a huge constant factor.
Re:A Solution of the P versus NP Problem? by Ar-Curunir on Monday August 14, 2017 @08:25PM (#15014311)
Yes, it would. The adversary in cryptography is assumed to be worst-case evil; it'll do whatever it can to break your algorithm, as long as it's performing a polynomial amount of computation. Remember, you're not just fighting your friendly neighborhood hacker, but possibly entire nation-states.
Re:A Solution of the P versus NP Problem? by PeterisP on Tuesday August 15, 2017 @02:13AM (#15015933)
You can easily have crypto that can't be broken with all the resources and time in the observable universe even if it's "just" polynomial with a sufficiently high coefficient.
Re:A Solution of the P versus NP Problem? by kevincox on Tuesday August 15, 2017 @03:40PM (#15021613)
Yes, but it becomes significantly more expensive. It might work but it is a huge difference in cost tradeoffs.
Re:A Solution of the P versus NP Problem? by nerdponx on Monday August 14, 2017 @02:01PM (#15010889)
Beyond crypto, problems like the traveling salesman would also be solvable in polynomial time.
Re:A Solution of the P versus NP Problem? by Govindae on Monday August 14, 2017 @02:23PM (#15011085)
Well... The traveling salesman decision problem, not the general case.

The problem of finding the optimum path is not in NP, if I give you a candidate solution you can't easily check if it's the global optimum.

What is in NP is the decision problem, finding a path that is better than a given bound. If I hand you a candidate solution, you just have to compare the sum of the distances to the bound to check it.

Re:A Solution of the P versus NP Problem? by hnaccy on Monday August 14, 2017 @04:11PM (#15012376)
If you can solve the decision TSP in polytime you can solve the optimization case in polytime.
Re:A Solution of the P versus NP Problem? by hexomancer on Monday August 14, 2017 @04:36PM (#15012620)
How?

edit: The wikipedia mentions that the TSP problem is NP-hard and explicitly says that the decision version of this problem is NP-complete. My assumption is that if the optimization version was proven to be NP-hard there would be no need to explicitly mention the decision version.

I can think of a way to use the decision version to find a solution to the optimization version but i feel like it must be flawed:

First we do a binary search on `L` (the length of the tour- input to the decision version) so we can find the optimal L within a factor of epsilon (maybe this epsilon is the flaw? But I don't think that is the case.) Now we pick an edge and increase its weight to infinity. Now we do the binary search again on the new graph. If the value of the optimal solution has changed it means that the edge must be in the optimal optimization solution. By doing the same process on all the edges we can find the optimal solution.

As I said there must be a flaw in the above algorithm but I can't find it.

Re:A Solution of the P versus NP Problem? by mihaild on Monday August 14, 2017 @04:51PM (#15012736)
First, use binary search to find answer. Then, remove edges one-by-one if removing this edge will not destroy all remaining path with shortest length, until your graph is reduced to a single cycle.
Re:A Solution of the P versus NP Problem? by hexomancer on Monday August 14, 2017 @04:55PM (#15012788)
Thanks for the answer, I have edited my post and I have basically the same solution. (Only instead of removing the edges I increase their weight to infinity because I think the TSP problem is defined only on complete graphs) But as I have mentioned in my comment I feel like this solution is flawed.
Re:A Solution of the P versus NP Problem? by zmonx on Monday August 14, 2017 @05:10PM (#15012945)
You can without loss of generality assume that the weights are integers (if they are rational, you can multiply all weights so that they become integral).

Hence, you can use bisection to compute the actual optimum, not involving epsilon at all.

Re:A Solution of the P versus NP Problem? by mihaild on Monday August 14, 2017 @05:17PM (#15013003)
Epsilon isn't a problem, as TSP is NP-complete even for integer weights. Your solution needs some modification for case where we have multiple optimal cycles (as you will find edges that are included in at least one cycle).

I don't think there is anything wrong with optimization been reducible to decision - it's quite common method both in theory and in practice.

Re:A Solution of the P versus NP Problem? by hexomancer on Monday August 14, 2017 @05:29PM (#15013109)
I didn't say there is anything wrong with reducing the optimization to decision in general. But I feel this specific application to the TSP problem may be flawed. (for the reasons i mentioned before. i.e wikipedia being very specific about the decision version) For another resource see: https://www.ibm.com/developerworks/community/blogs/jfp/entry...

note: I am not implying that the above source is reputable. But it does hint that the solution to this problem probably is not this trivial.

Re:A Solution of the P versus NP Problem? by mihaild on Monday August 14, 2017 @05:39PM (#15013209)
Decision version of TSP is NP-complete. Optimization version is Cook-reducible to decision version of TSP. And it problem is Cook-reducible to P-problem, then the problem is itself in P. (note that it's not true if you replace P with NP, for example)
Re:A Solution of the P versus NP Problem? by hexomancer on Tuesday August 15, 2017 @02:27AM (#15015983)
Do you have a reference to a reputable source that proves the optimization version is cook-reducable to decision version?
Re:A Solution of the P versus NP Problem? by mihaild on Tuesday August 15, 2017 @02:44PM (#15021106)
I don't. (it's always hard to find reference for easy problems)
Re:A Solution of the P versus NP Problem? by PrunJuice on Monday August 14, 2017 @11:28PM (#15015163)
One minor foible. Don't select edges that are part of the minimum path, instead remove edges that are not part of the minimum path until only the minimum path remains. This strategy works even on graphs with multiple minimum paths.
Re:A Solution of the P versus NP Problem? by hexomancer on Tuesday August 15, 2017 @02:56AM (#15016086)
I don't get why having multiple optimal paths would falsify my algorithm. Can you provide an explicit counter-example?

Here is why I think the algorithm is correct:

At each step the edge that we are considering is either contained in all the optimal solutions or only some of them. If the edge is contained in all the solutions, increasing its weight to infinity would change the optimal solution and we pick that edge in our solution. Otherwise (if the edge is contained in only some of the solutions) increasing the weight would not change the solution because there is another optimal solution that does not contain that edge so we do not pick that edge.

So we can prove this theorem: At every step of the algorithm if an edge is picked, it is contained in all the optimal solutions.

So the algorithm does not pick any extra edges. Now we have to prove that it includes all the necessary edges. But that is easy because each time that we choose not to including an edge, we are sure that there is an optimal solution in the remaining graph so we are never left with a graph with no optimal solution.

I think you assumed that I meant we change the edge weights from infinity back to their original value at each step but that is not what I meant.

Re:A Solution of the P versus NP Problem? by PrunJuice on Tuesday August 15, 2017 @03:41AM (#15016244)
> If the value of the optimal solution has changed it means that the edge must be in the optimal optimization solution.

I interpreted this as meaning you were selecting the falsifying removals' edges, instead of removing the non-falsifying ones. You've got it.