  We discuss the optimal matching solution for both the assignment problem and
the matching problem in one dimension for a large class of convex cost
functions. We consider the problem in a compact set with the topology both of
the interval and of the circumference. Afterwards, we assume the points'
positions to be random variables identically and independently distributed on
the considered domain. We analytically obtain the average optimal cost in the
asymptotic regime of very large number of points $N$ and some correlation
functions for a power-law type cost function in the form $c(z)=z^p$, both in
the $p>1$ case and in the $p<0$ case. The scaling of the optimal mean cost with
the number of points is $N^{-\frac{p}{2}}$ for the assignment and $N^{-p}$ for
the matching when $p>1$, whereas in both cases it is a constant when $p<0$.
Finally, our predictions are compared with the results of numerical
simulations.
