  In this paper, we address the numerical solution to the multimarginal optimal
transport (MMOT) with pairwise costs. MMOT, as a natural extension from the
classical two-marginal optimal transport, has many important applications
including image processing, density functional theory and machine learning, but
yet lacks efficient and exact numerical methods. The popular
entropy-regularized method may suffer numerical instability and blurring
issues. Inspired by the back-and-forth method introduced by Jacobs and
L\'{e}ger, we investigate MMOT problems with pairwise costs. First, such
problems have a graphical representation and we prove equivalent MMOT problems
that have a tree representation. Second, we introduce a noval algorithm to
solve MMOT on a rooted tree, by gradient based method on the dual formulation.
Last, we obtain accurate solutions which can be used for the
regularization-free applications.
