def lsa_solve_scipy(costs):
    """Solves the LSA problem using the scipy library."""

    from scipy.optimize import linear_sum_assignment as scipy_solve

    # scipy (1.3.3) does not support nan or inf values
    finite_costs = add_expensive_edges(costs)
    rids, cids = scipy_solve(finite_costs)
    rids, cids = _exclude_missing_edges(costs, rids, cids)
    return rids, cids
Solves the LSA problem using the scipy library.
motmetrics/lap.py