Hi,
I'm using KuhnMunkresMinimalWeightBipartitePerfectMatching from
JgraphT for Assignment
Problem <https://en.wikipedia.org/wiki/Assignment_problem>.
When I pass Double.NaN as weight for any assignment, the algorithm seems to
take forever (12 minutes and counting as of last run). It works fine when
Double.MAX_VALUE is passed.
For example, for bipartite graph corresponding to following cost matrix -
// 1
2
costs = new double[][]{{1.0 , Double.MAX_VALUE},
// 3
{Double.MAX_VALUE, Double.MAX_VALUE}}; // 4
Algorithm returns matching -
1 3 1.0
2 4 1.7976931348623157E308
Which is fine, I can always compare EdgeWeight with Double.MAX_VALUE. But
Ideally, I'd like to pass Double.NaN to indicate that these edges should
not be considered to begin with.
Is it possible?
(HopcroftKarpBipartiteMatching from JGraphT seems to work fine even with
Double.NaN as values.)
Thanks.
|