FugroRoames / Munkres.jl

Munkres algorithm for the optimal assignment problem
Other
20 stars 7 forks source link

Small performance change in smallest uncovered and tidy up #3

Closed PaulBellette closed 7 years ago

PaulBellette commented 7 years ago

Hi,

Have been playing a little bit and made a small change in how find_smallest_uncovered works. Tiny bit faster and less mind bending (hopefully). Also took out my awesome_print_debug function. In the process of looking at this stuff I also found a performance issue with using the modified cost type. The Base.get_index modification is slower than it should be. Will make an issue about this...

c42f commented 7 years ago

:+1: Looks good to me.

A bit mind bending, but I think this is correct.

It looks like the entire code could potentially be rearranged so that zero_locations is tracked as tuples the same way that you track it in the new find_smallest_uncovered. Perhaps if this was a Set things would be simpler and more efficient in the removal and addition of zeros? Not sure.