def update_mapping(self, *physical_edges: QidPair):
        """Updates the mapping in accordance with SWAPs on the given physical
        edges."""
        for physical_edge in physical_edges:
            old_logical_edge = tuple(self.phys_to_log(*physical_edge))
            new_logical_edge = old_logical_edge[::-1]
            for p, l in zip(physical_edge, new_logical_edge):
                self._phys_to_log[p] = l
                if l is not None:
                    self._log_to_phys[l] = p
Updates the mapping in accordance with SWAPs on the given physical
        edges.
cirq-core/cirq/contrib/routing/greedy.py