def breadth_first_search(A, start):
    '\n    Breadth-First-Search (BFS) of a graph in CSR or CSC matrix format starting\n    from a given node (row).  Takes Qobjs and CSR or CSC matrices as inputs.\n    \n    This function requires a matrix with symmetric structure.\n    Use A+trans(A) if original matrix is not symmetric or not sure.\n    \n    Parameters\n    ----------\n    A : qobj, csr_matrix\n        Input graph in CSR matrix form\n    \n    start : int\n        Staring node for BFS traversal.\n    \n    Returns\n    -------\n    order : array\n        Order in which nodes are traversed from starting node.\n    \n    levels : array\n        Level of the nodes in the order that they are traversed.\n    \n    '
    if (A.__class__.__name__ == 'Qobj'):
        A = A.data
    num_rows = A.shape[0]
    start = int(start)
    (order, levels) = _breadth_first_search(A.indices, A.indptr, num_rows, start)
    return (order[(order != (- 1))], levels[(levels != (- 1))])
Breadth-First-Search (BFS) of a graph in CSR or CSC matrix format starting
from a given node (row).  Takes Qobjs and CSR or CSC matrices as inputs.

This function requires a matrix with symmetric structure.
Use A+trans(A) if original matrix is not symmetric or not sure.

Parameters
----------
A : qobj, csr_matrix
    Input graph in CSR matrix form

start : int
    Staring node for BFS traversal.

Returns
-------
order : array
    Order in which nodes are traversed from starting node.

levels : array
    Level of the nodes in the order that they are traversed.
def breadth_first_search(A, start):
    '\n    Breadth-First-Search (BFS) of a graph in CSR or CSC matrix format starting\n    from a given node (row).  Takes Qobjs and CSR or CSC matrices as inputs.\n    \n    This function requires a matrix with symmetric structure.\n    Use A+trans(A) if original matrix is not symmetric or not sure.\n    \n    Parameters\n    ----------\n    A : qobj, csr_matrix\n        Input graph in CSR matrix form\n    \n    start : int\n        Staring node for BFS traversal.\n    \n    Returns\n    -------\n    order : array\n        Order in which nodes are traversed from starting node.\n    \n    levels : array\n        Level of the nodes in the order that they are traversed.\n    \n    '
    if (A.__class__.__name__ == 'Qobj'):
        A = A.data
    num_rows = A.shape[0]
    start = int(start)
    (order, levels) = _breadth_first_search(A.indices, A.indptr, num_rows, start)
    return (order[(order != (- 1))], levels[(levels != (- 1))])