def dedupe_matching(matching):
    """
    Remove duplicates node pairs from the output of networkx.algorithms.max_weight_matching since we don't care about order.

    Args:
        matching (dict): output from networkx.algorithms.max_weight_matching.  key is "from" node, value is "to" node.

    Returns:
        list[2tuples]: list of node pairs from `matching` deduped (ignoring order).
    """
    matched_pairs_w_dupes = [tuple(sorted([k, v])) for k, v in matching.items()]
    return list(set(matched_pairs_w_dupes))