def shortest_path(self, lq1: int, lq2: int) -> Sequence[int]:
        """Find the shortest path between two logical qubits on the device, given their mapping.

        Args:
            lq1: integer corresponding to the first logical qubit.
            lq2: integer corresponding to the second logical qubit.

        Returns:
            A sequence of logical qubit integers on the shortest path from `lq1` to `lq2`.
        """
        return self.physical_to_logical[
            nx.reconstruct_path(*self.logical_to_physical[[lq1, lq2]], self._predecessors)
        ]
Find the shortest path between two logical qubits on the device, given their mapping.

        Args:
            lq1: integer corresponding to the first logical qubit.
            lq2: integer corresponding to the second logical qubit.

        Returns:
            A sequence of logical qubit integers on the shortest path from `lq1` to `lq2`.
        
cirq-core/cirq/transformers/routing/mapping_manager.py