core/utils/hungarian_algorithm library
Hungarian (Kuhn–Munkres) algorithm for minimum-cost assignment.
Given an n × n cost matrix, HungarianAlgorithm(costs).getAssignment()
returns a List<int> where result[agent] = task is the task
assigned to each agent in the optimal (minimum total cost)
bipartite matching. If the underlying problem is rectangular
(fewer real GT objects than predicted queries), pad with a large
sentinel cost so unmatched rows get pushed to the pad columns.
Pure Dart, host-side. Used by the DETR-style object-detection demos to align predicted query slots to ground-truth boxes.