(queue, remaining)
return cost, k1, k2, k12
Default contraction chooser that simply takes the minimum cost option.
Default contraction chooser that simply takes the minimum cost option.
Default contraction chooser that simply takes the minimum cost option .
def _simple_chooser(queue, remaining):
    """Default contraction chooser that simply takes the minimum cost option."""
    cost, k1, k2, k12 = heapq.heappop(queue)
    if k1 not in remaining or k2 not in remaining:
        return None  # candidate is obsolete
    return cost, k1, k2, k12
def _simple_chooser ( queue , remaining ) : cost , k1 , k2 , k12 = heapq . heappop ( queue ) if k1 not in remaining or k2 not in remaining : return None # candidate is obsolete return cost , k1 , k2 , k12