An ODE characterization of multi-marginal optimal transport with pairwise cost functions | Synapse