Before revision:  We present an O(n^2) time algorithm for computing a one dimensional MMD (OMMD) , where the input point sets S and T lie on the line and |S|+|T| = n . Then, we study a generalized version of MMD problem, that is the many-to-many matching with demands and capacities problem (MMDC), that in which each point has a limited capacity in addition to a demand.
After revision:  We present an O(n^2) time algorithm for computing a one dimensional MMD (OMMD) , where the input point sets S and T lie on the line and the cost of matching a point to another point is equal to the distance between the two points . Then, we study a generalized version of MMD problem, that is the many-to-many matching with demands and capacities problem (MMDC), that in which each point has a limited capacity in addition to a demand.