Computing the empirical Wasserstein distance in the Wasserstein-distance-based independence test is an optimal transport (OT) problem with a special structure. This observation inspires us to study a special type of OT problem and propose a modified Hungarian algorithm to solve it exactly. For the OT problem involving two marginals with $m$ and $n$ atoms ($m\geq n$), respectively, the computational complexity of the proposed algorithm is $O(m^2n)$. Computing the empirical Wasserstein distance in the independence test requires solving this special type of OT problem, where $m=n^2$. The associated computational complexity of the proposed algorithm is $O(n^5)$, while the order of applying the classic Hungarian algorithm is $O(n^6)$. In addition to the aforementioned special type of OT problem, it is shown that the modified Hungarian algorithm could be adopted to solve a wider range of OT problems. Broader applications of the proposed algorithm are discussed -- solving the one-to-many assignment problem and the many-to-many assignment problem. We conduct numerical experiments to validate our theoretical results. The experiment results demonstrate that the proposed modified Hungarian algorithm compares favorably with the Hungarian algorithm, the well-known Sinkhorn algorithm, and the network simplex algorithm.
翻译:在基于Wasserstein距离的独立性检验中,计算经验Wasserstein距离是一个具有特殊结构的最优传输(OT)问题。这一观察启发我们研究一种特殊类型的最优传输问题,并提出一种修正的匈牙利算法对其进行精确求解。对于涉及两个边缘分布、分别包含$m$和$n$个原子($m\geq n$)的最优传输问题,所提算法的计算复杂度为$O(m^2n)$。在独立性检验中计算经验Wasserstein距离需解此特殊类型的最优传输问题,此时$m=n^2$,所提算法的相应计算复杂度为$O(n^5)$,而直接应用经典匈牙利算法的复杂度为$O(n^6)$。除上述特殊类型的最优传输问题外,我们证明修正匈牙利算法还可用于求解更广泛的一类最优传输问题。本文讨论了该算法的更广泛应用——解决一对多指派问题和多对多指派问题。我们通过数值实验验证了理论结果,实验结果表明,所提出的修正匈牙利算法优于匈牙利算法、著名的Sinkhorn算法以及网络单纯形算法。