`if self.pair_cost_heap:` should be sufficient