def __init__(self, device_graph: nx.Graph):
        """Initializes the circuit routing transformer.

        Args:
            device_graph: The connectivity graph of physical qubits.

        Raises:
            ValueError: if `device_graph` is a directed graph.
        """

        if nx.is_directed(device_graph):
            raise ValueError("Device graph must be undirected.")
        self.device_graph = device_graph
Initializes the circuit routing transformer.

        Args:
            device_graph: The connectivity graph of physical qubits.

        Raises:
            ValueError: if `device_graph` is a directed graph.
        
cirq-core/cirq/transformers/routing/route_circuit_cqc.py