Munkres algorithm for Python