def apply_swap(self, *physical_edges: QidPair):
        """Applies SWAP on the given edges."""
        self.update_mapping(*physical_edges)
        self.physical_ops += [SWAP(*e) for e in physical_edges]
Applies SWAP on the given edges.
cirq-core/cirq/contrib/routing/greedy.py