Class AttributeStructuralFeatureAllocator.HungarianAllocator

  • Enclosing class:

    public class AttributeStructuralFeatureAllocator.HungarianAllocator
    extends Object
    Class implementing the Hungarian algorithm for attribute to feature allocation Adapted from
    • Constructor Detail

      • HungarianAllocator

        public HungarianAllocator​(List<String> attributeValues,
                                  List<String> slots)
    • Method Detail

      • subtractRowMinimal

        public void subtractRowMinimal()
        Step 1 Subtract from every element the minimum value from its row
      • subtractColMinimal

        public void subtractColMinimal()
        Step 2 Subtract from every element the minimum value from its column
      • coverZeros

        public void coverZeros()
        Step 3.1 Loop through all elements, and run colorNeighbors when the element visited is equal to zero
      • createAdditionalZeros

        public void createAdditionalZeros()
        Step 4 This step is not always executed. (Check the algorithm in the constructor) Create additional zeros, by coloring the minimum value of uncovered cells (cells not colored by any line)
      • optimization

        public boolean optimization()
        Overload optimization(int row) method
      • getResult

        public int[] getResult()
        Get the result by returning an array containing the cell assigned for each row
        Array of rows where each array index represent the row number, and the value at each index is the column assigned to the corresponding row
      • cloneMatrix

        public int[][] cloneMatrix​(int[][] matrix)
        Clone the 2D array
        A copy of the 2D array