Skip to main content
QUICK REVIEW

[论文解读] A Subquadratic Algorithm for 3XOR

Martin Dietzfelbinger, Philipp Schlag|arXiv (Cornell University)|Jan 1, 2018
Complexity and Algorithms in Graphs参考文献 3被引用 1
一句话总结

该论文提出了一种确定性 O(n²) 算法来解决 3XOR 问题,采用专门设计的 Patricia trie,可对任意 a 实现 a ⊕X 的线性时间遍历,从而达到最优的平方时间复杂度。此外,还提出了一种随机化算法,当 w = O(n log n) 时,其期望时间复杂度为 O(n² · min{log³w/w, (log log n)²/log²n}),与目前已知的 int3SUM 边界仅相差 log w 因子,并通过将 3XOR 归约至离线 SetDisjointness 和 SetIntersection 问题,建立了条件下界。

ABSTRACT

Given a set X of n binary words of equal length w, the 3XOR problem asks for three elements a, b, c in X such that a oplus b=c, where oplus denotes the bitwise XOR operation. The problem can be easily solved on a word RAM with word length w in time O(n^2 log n). Using Han's fast integer sorting algorithm (STOC/J. Algorithms, 2002/2004) this can be reduced to O(n^2 log log n). With randomization or a sophisticated deterministic dictionary construction, creating a hash table for X with constant lookup time leads to an algorithm with (expected) running time O(n^2). At present, seemingly no faster algorithms are known. We present a surprisingly simple deterministic, quadratic time algorithm for 3XOR. Its core is a version of the PATRICIA tree for X, which makes it possible to traverse the set a oplus X in ascending order for arbitrary a in {0, 1}^{w} in linear time. Furthermore, we describe a randomized algorithm for 3XOR with expected running time O(n^2 * min{log^3(w)/w, (log log n)^2/log^2 n}). The algorithm transfers techniques to our setting that were used by Baran, Demaine, and Patrascu (WADS/Algorithmica, 2005/2008) for solving the related int3SUM problem (the same problem with integer addition in place of binary XOR) in expected time o(n^2). As suggested by Jafargholi and Viola (Algorithmica, 2016), linear hash functions are employed. The latter authors also showed that assuming 3XOR needs expected running time n^(2-o(1)) one can prove conditional lower bounds for triangle enumeration just as with 3SUM. We demonstrate that 3XOR can be reduced to other problems as well, treating the examples offline SetDisjointness and offline SetIntersection, which were studied for 3SUM by Kopelowitz, Pettie, and Porat (SODA, 2016).

研究动机与目标

  • 开发一种针对 3XOR 问题的确定性、亚二次时间算法,尽管在 3SUM 问题上已有大量研究,但该问题仍为开放问题。
  • 将 Baran、Demaine 和 Pâtraşcu 提出的 int3SUM 问题技术,特别是线性哈希和字级操作,适配至 3XOR 环境。
  • 通过将 3XOR 归约至离线 SetDisjointness 和 SetIntersection 问题,建立 3XOR 的条件时间复杂度下界,其方式与 3SUM 复杂度分析中的归约方法一致。
  • 探讨 3XOR 与 3SUM 之间在结构上的相似性是否暗示其最优时间复杂度存在更深层次的联系,尤其是考虑到 XOR 中不存在 Fredman 的技巧。

提出的方法

  • 仅使用字操作构建一个与 word-RAM 兼容的 Patricia trie,避免位级操作,从而对任意 a ∈{0,1}^w 实现 a ⊕X 的 O(|X|) 时间升序遍历。
  • 使用线性、1-通用哈希函数将 X 划分为多个桶,通过哈希和桶交集检查实现高效的随机化搜索。
  • 采用多级哈希方案 h2(x) = h21(x) ◦ h22(x),其中 h21 和 h22 属于 1-通用类,以减少随机化算法中的误报。
  • 在离线归约中,利用哈希值和异或移位构造偏移桶集合 X↑_u,v 和 X↓_u,v,通过检查交集是否非空来检测解。
  • 使用 Θ(log n) 个哈希函数选择,将误报概率多项式有界,从而以高概率保证正确性。
  • 从交集结果中重构解,并在 O(n²) 时间内验证,确保整体算法效率不受影响。

实验结果

研究问题

  • RQ1能否仅通过字级操作和专用的 Patricia trie 结构,实现 3XOR 的确定性 O(n²) 算法?
  • RQ2能否实现一种随机化 3XOR 算法,使其期望运行时间接近目前已知的 int3SUM 边界,即 O(n² · min{log³w/w, (log log n)²/log²n})?
  • RQ3能否以保持条件时间复杂度下界的方式,将 3XOR 归约至离线 SetDisjointness 和 SetIntersection 问题,类似于 3SUM 范式中的归约方式?
  • RQ4为何 Fredman 的 3SUM 技巧无法推广至 3XOR?其背后的结构性差异是什么?

主要发现

  • 通过构建支持任意 a 的 a ⊕X 线性时间遍历的 Patricia trie,仅使用字操作,3XOR 的确定性算法可在 O(n²) 时间内运行。
  • 随机化算法在 w = O(n log n) 条件下,期望运行时间为 O(n² · min{log³w/w, (log log n)²/log²n}),与 int3SUM 的最佳边界仅相差 log w 因子。
  • 当 w > n log n 时,算法运行时间为 O(n log²n),w 与 log n 依赖关系的交叉点出现在 w = (log²n) log log n 处。
  • 本文将 3XOR 归约至离线 SetDisjointness 和 SetIntersection 问题,表明若 3XOR 可在 o(n²) 时间内求解,则意味着这些问题也可获得亚二次解法。
  • 随机化归约中的误报期望数量为 O(n²−δ),通过采样 Θ(n log n) 次,整体算法的期望运行时间仍保持在 O(n²−Ω(1))。
  • XOR 中不存在 Fredman 类型的恒等式(即不存在满足 a ⊕b ≺c ⊕d ⇔ a ⊕d ≺c ⊕b 的线性序),这表明 3XOR 与 3SUM 之间存在根本性的结构差异,尽管二者表面相似。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。