 Thus, the infinitesimal mass transported from formula_43 to formula_44 is formula_62, and the cost of moving is formula_63, following the definition of the cost function.Therefore, the total cost of a transport plan formula_57 is

The plan formula_57 is not unique; the optimal transport plan is the plan with the minimal cost out of all possible transport plans.As mentioned, the requirement for a plan to be valid is that it is a joint distribution with marginals formula_7 and formula_15; letting formula_69 denote the set of all such measures as in the first section, the cost of the optimal plan is
If the cost of a move is simply the distance between the two points, then the optimal cost is identical to the definition of the formula_71 distance.