A faster way to compute edit distance does not exist
bostonglobe.com
bostonglobe.com
The article does not prove that subquadratic edit distance algorithms do not exist. It only proves it conditional to another unproven complexity hypothesis (SETH). In other words, it shows that if such algorithms exist, then faster algorithms exist for another problem (SAT for CNF formulae with certain size bounds), where we haven't been able to find them yet. See the original article http://arxiv.org/abs/1412.0348 whose title is more accurate.
This is important work, of course, and provides more evidence that faster edit distance computation is not possible, but it is not proven yet.
A more accurate wording would be that the existence of a fast algorithm for edit distance implies that P is "close" to NP, because there would exist a sub-exponential algorithm for SAT (but not necessarily a polynomial algorithm).
To put it another way, representing the world as if P!=NP is no less reasonable than representing the world as if Newtonian physics are applicable.
There is such a thing as experimental truth, but it applies to experimental fields, and theoretical CS is usually not thought as one of them. I still think it is misleading to claim that the inexistence of something has been proven if it is conditional to another hypothesis.
Or to put it another way, P!=NP is a de facto if not de jure axiom of theoretical computer science. And the burden of justification is on anyone whose conclusions are not premised on P!=NP just as it is a biologist who takes issue with evolution by saying "it's only a theory."
Science does not deal in proofs, for example, the wiki page on scientific method does not use the word except in the mathematical sense [0].
Science deals in hypotheses, evidence, and models.
[1]: http://www.thatmarcusfamily.org/philosophy/Course_Websites/R...
Science can never prove truth or falsity of anything - it only provides evidence for or against hypotheses, but every single thing can be changed subject to future evidence. As such, there is no true/false in science, only degrees of evidence.
This article, which you claim uses proof "in the scientific sense," does not prove a hypothesis is false, only that is gets less and less likely and competing ones get more and more likely, which is what your examples are getting at. The article proves (in the mathematical sense) the non-existence of an item, only if a certain conjecture is true.
As pointed out above, this is math, not empirical.
As was commented last time this was posted: Just because it's not possible to do better in the general case doesn't mean it isn't possible to do better in your case. For all we know, human genomes may not actually be 100% random strings, but may have some kind of structure that makes it possible to do it faster. Even when solving the problem exactly.
Moreover, I'm not sure if it would ever actually be useful to compute the edit distance between two full genomes. Edit distances/local/global alignments are useful for short fragments (gene's/reads etc) but not the full sequence.
Instead of aligning two genomes this way, people normally start with a very well calibrated and fairly accurate reference sequence, then align to that structure probabilistically, and "call the joint variants".
This is actually far more interesting that doing the raw hard problems that computer scientists love to talk about theoretically. One of the reasons it's so interesting is that different genomes differ by operations that are much more complex than simple edit distance- for example, large regions can be excised, and placed, in reverse order, in completely other parts of the genome. Trying to use a DP edit distance calculation to detecet those is futile.
- I assume this is worst case complexity. While this is useful, maybe the average time can be much lower for certain data (like the genome).
- I assume the theorem doesn't restrict the input strings in any way. If you put restrictions on the input then there could be a faster algorithm than the general one. I don't know if this can be applied to the genome though.
- People are interested in the constant factor too.
For example, I could assume that there no deletions and insertions, only changes and then the problem becomes embarrasingly paralell and extremely easy to express in assembly-like operations. So I could paralellize it on a GPU by splitting the string into fixed length substrings and get huge gains. Problem is, can it be safely assumed that there are no deletions and insertions?
Wikipedia has a list with some modifications that can also be used to speedup the calculation under certain constraints: https://en.wikipedia.org/wiki/Wagner%E2%80%93Fischer_algorit...
I'm curious how fast we could do it on the raw 'string' in the worst case (assuming DNA is entirely random) but it's out of my scope, anyone hazard a guess?
I'd like to request a title change - "New proof that a faster way to compute edit distance might be tied up in the P vs. NP problem"
For instance, computing cardinality of a value over a huge dataset (distributed or otherwise) that is assumed to be evenly distributed would take memory proportional to the size of the dataset for 100% precision. Implementing a cardinality approximation algorithm like HyperLogLog++ lets you get a pretty close to accurate result for this calculation but with far fewer resources. There are many others and I think it is important to consider this trade off when it is appropriate.
Of course, it makes an assumption that the data is distributed more or less evenly.
Or in other words, for certain classes of inputs, we can find a faster algorithm. We only need to find/define those classes.
Again, I know that's not precisely what you asked. I can't think of a reduction from "insert+delete only" problems to "insert+delete+subst" (all operations cost 1) problems (where solving the latter gives you a solution to the former, and the size is no more than k times the original).
Eg. what's the edit distance between these two strings?
AAAA BBBB
Traditionally, it would be 4, but it's unclear if you allow only inserts and deletions.
> Eg. what's the edit distance between these two strings?
>
> AAAA BBBB
>
> Traditionally, it would be 4, but it's unclear if you
> allow only inserts and deletions.
It is >= 8, since you surely have to remove 4 As and insert 4 Bs. Since these 8 transformations indeed transform AAAA into BBBB, it is exactly 8.It is very easy to generalize the Wagner-Fisher algorithm (https://en.wikipedia.org/wiki/Wagner%E2%80%93Fischer_algorit...) to this "simpler" variant of edit distance, but this algorithm will still have a (worst-case) runtime of O(m*n), where m, n are the lengths of the two strings.
Of course, the question remains: Is there a (worst-case) faster algorithm?
So I guess we will soon see a lot of crypto based on calculating edit distances?
> I mean that there needs to be a fundamental difference between the
> difficulty of finding a solution and validating one. There's none in
> case of edit distance.
If you consider the decision problem "Is the edit distance <= d?", there is (according to this result) a fundamental difference - though only a polynomial one.To see this, consider the following argument:
Clearly the edit distance between strings of length m, n is bounded by m+n (>= d). So if we found a way to transform the string s1 into s2 using d steps, we can construct a certificate of length O(m+n) (worst case) steps, which can be verified in linear time.
On the other hand (according to this result) you need Omega(m*n) (worst case) steps to find such a certificate.
What if an email could be parsed in such a way as to generate seed data for an an NP problem which the sender must solve and supply the answer in the in the email header...
If the receiver can instantly dismiss any emails that provide an answer that can not be verified, then that could have a huge impact on the the spammers ability to send spam in the volumes they currently enjoy. A penalty of 5 seconds per email is unlikely to impact ordinary users, but would be a major pain for spammers.
Also, could this be used to throttle user input to mitigate brute force attacks?
n^2 is insufficient, but 'polynomial' as a category is not necessarily bad.
P=NP is not the end of the world, by itself.
A technique which requires both n^100 for validation and computing is useless, a technique which requires n^2 for computation and log(log(n)) for validation would be fine (you just have to use sufficiently large n).
It's just that problems with an exponential computation and polynomial validation provide an almost unbeatable cost-to-benefit ratio in terms of n. A n^2/log(log(n)) algorithm might require 10MB encryption keys to be secure, while a n^a/n algorithm like the current prime-based cryptosystems require ~4KB.
And I think it's implied that validation has to actually be possible on computers, so given that constraint an enormous number for brute-forcing will almost always be a solid option.
So n^2/anything is going to suck. n^3/anything or n^4/anything may or may not suck. And n^100/n^small is great.
Also RSA operations aren't n^a/n. They're sub-exponential to brute force, and n^3 to encrypt and decrypt. Unless you mean a different system.
Secondly, it is possible to do better than the Wagner-Fischer algorithm in certain cases. I figured this out myself and was about to write a paper on it when I realized that other researchers had beat me to it by a couple of decades.
If the two strings are equal you can establish that the edit distance is 0 in linear time, obviously. If you consider how the algorithm fills out the square down the diagonal you'll see that if there's only a one-letter difference you only actually need to fill out small parts of the grid around that difference.
This is generalizable, so the complexity actually depends on the distance between the strings.
This is certainly useful in practice, but it doesn't affect whether the worst- or average-case complexity is quadratic. I'd like to see a quadratic (or exponential etc) time problem that couldn't be solved faster in many cases.