used Hungarian algorithm to match point pairs such that total cost is minimized