There are n white dots and n black dots. Equally spaced in a line. You want to connect each white dot with some block dot in one to one fashion with a minimum total length of wire.
Consider 2 examples:
Greedy algorithm gives optimal solution for
X->YZ , Y->XZ , ...