Class KuhnMunkresStern


  • @Reference(authors="K. L. Stern",
               title="The Hungarian Algorithm for the Assignment Problem",
               booktitle="Online",
               url="http://software-and-algorithms.blogspot.com/2012/09/the-hungarian-algorithm-for-assignment.html",
               bibkey="web/Stern12")
    public class KuhnMunkresStern
    extends KuhnMunkresWong
    A version of Kuhn-Munkres inspired by the implementation of Kevin L. Stern. This approach shares some ideas of KuhnMunkresWong, but works on columns instead of rows first. So far, we have not found a good reference why this works much faster is practice; but it does.

    References:

    K. L. Stern
    The Hungarian Algorithm for the Assignment Problem
    http://software-and-algorithms.blogspot.com/2012/09/the-hungarian-algorithm-for-assignment.html

    Since:
    0.8.0
    Author:
    Erich Schubert
    • Field Detail

      • cptr

        private int[] cptr
        Pointer to the minimum non-marked value, for each column; but initially to the starting row.
      • cmin

        private double[] cmin
        Minimum value of non-marked row, for each column.
    • Constructor Detail

      • KuhnMunkresStern

        public KuhnMunkresStern()
    • Method Detail

      • run

        public int[] run​(double[][] cost)
        Description copied from class: KuhnMunkresWong
        Perform the Kuhn-Munkres algorithm.
        Overrides:
        run in class KuhnMunkresWong
        Parameters:
        cost - Cost matrix
        Returns:
        Selected columns, per row
      • removeCost

        protected void removeCost​(double h)
        Description copied from class: KuhnMunkresWong
        Remove cost h (if > 0) found to be unavoidable.
        Overrides:
        removeCost in class KuhnMunkresWong
        Parameters:
        h - Cost to remove