presolve_EMD function

Solve the earthmover's distance problem