/*exported Hungarian*/
var Hungarian = (function() {
  'use strict';

  /**
   * Array minima mutation functions.
   */
  function subtractRowMinima( row ) {
    var min = Math.min.apply( Math, row );

    for ( var i = 0, il = row.length; i < il; i++ ) {
      row[i] -= min;
    }

    return row;
  }

  function subtractRowsMinima( array ) {
    var i, il;
    for ( i = 0, il = array.length; i < il; i++ ) {
      subtractRowMinima( array[i] );
    }
  }

  /**
   * Takes a two-dimensional n by m matrix.
   */
  function subtractColumnMinima( array, columnIndex ) {
    var min = Number.POSITIVE_INFINITY;
    var value;
    var i, il;
    // Create col array and find min.
    for ( i = 0, il = array.length; i < il; i++ ) {
      value = array[i][ columnIndex ];
      if ( value < min ) {
        min = value;
      }
    }

    for ( i = 0, il = array.length; i < il; i++ ) {
      array[i][ columnIndex ] -= min;
    }

    return array;
  }

  function subtractColumnsMinima( array ) {
    var i, il;
    for ( i = 0, il = array[0].length; i < il; i++ ) {
      subtractColumnMinima( array, i );
    }
  }

  function calculate( costMatrix ) {
    subtractRowsMinima( costMatrix );
    subtractColumnsMinima( costMatrix );
  }

  return {
    calculate: calculate
  };

}) ();

@@ -524,35 +524,32 @@
 tion subtractCol
-umn
 Minima( array, c
@@ -546,27 +546,24 @@
 ( array, col
-umn
 Index ) %7B%0A  
@@ -743,27 +743,24 @@
 rray%5Bi%5D%5B col
-umn
 Index %5D;%0A   
@@ -890,19 +890,16 @@
 %5Bi%5D%5B col
-umn
 Index %5D 
@@ -950,35 +950,32 @@
 tion subtractCol
-umn
 sMinima( array )
@@ -1064,19 +1064,16 @@
 tractCol
-umn
 Minima( 
@@ -1128,24 +1128,77 @@
 tMatrix ) %7B%0A
+    var coveredRows = %5B%5D,%0A        coveredCols = %5B%5D;%0A%0A
     subtract
@@ -1242,11 +1242,8 @@
 tCol
-umn
 sMin

Use col(s) abbreviation for column(s).