Improving the Hungarian assignment algorithm