Java implementation of the Hungarian Algorithm