code: def linear_assignment(X):
      """Solve the linear assignment problem using the Hungarian algorithm.
  
      The problem is also known as maximum weight matching in bipartite graphs.
      The method is also known as the Munkres or Kuhn-Munkres algorithm.
  
      Parameters
      ----------
      X : array
          The cost matrix of the bipartite graph
  
      Returns
      -------
      indices : array,
          The pairs of (row, col) indices in the original array giving
          the original ordering.
  
      References
      ----------
  
      1. http://www.public.iastate.edu/~ddoty/HungarianAlgorithm.html
  
      2. Harold W. Kuhn. The Hungarian Method for the assignment problem.
         *Naval Research Logistics Quarterly*, 2:83-97, 1955.
  
      3. Harold W. Kuhn. Variants of the Hungarian method for assignment
         problems. *Naval Research Logistics Quarterly*, 3: 253-258, 1956.
  
      4. Munkres, J. Algorithms for the Assignment and Transportation Problems.
         *Journal of the Society of Industrial and Applied Mathematics*,
         5(1):32-38, March, 1957.
  
      5. https://en.wikipedia.org/wiki/Hungarian_algorithm
      """
      indices = _hungarian(X).tolist()
      indices.sort()
      # Re-force dtype to ints in case of empty list
      indices = np.array(indices, dtype=int)
      # Make sure the array is 2D with 2 columns.
      # This is needed when dealing with an empty list
      indices.shape = (-1, 2)
      return indices
  
file_path: catboost/contrib/python/scikit-learn/py2/sklearn/utils/linear_assignment_.py
imports: import numpy
  from .fixes import astype
label_desc: Use image node_id 1 for calling a global function with example usage: linear_assignment(X) and returns: indices