Testing logic for Hungarian algorithm