Levenshtein(编辑距离)算法在原生图形数据库中的执行速度是否比 O(n*m) 快?

Does the Levenshtein (Edit Distance) algorithm perform faster than O(n*m) in a native graph database?

Levenshtein(编辑距离)在 Neo4j 等原生图形数据库中的时间复杂度是否会比 O(n*m) 的当前限制更好?如果是,为什么?

自从implementations of apoc.text.levenshteinDistance and apoc.text.levenshteinSimilarity simply rely on org.apache.commons.text.similarity.LevenshteinDistance做计算以来,APOC库没有引入任何复杂度改进。

无论如何,这样的计算应该只是比较 2 个文本字符串,而不应该以任何方式依赖于数据库的图形特性。

最后,it has been proven that the complexity cannot be improved (unless the Strong Exponential Time Hypothesis 是错误的)。