def read_adjacency_matrix(file_path, separator):
    """
    Reads an edge list in csv format and returns the adjacency matrix in SciPy Sparse COOrdinate format.

    Inputs:  - file_path: The path where the adjacency matrix is stored.
             - separator: The delimiter among values (e.g. ",", "\t", " ")

    Outputs: - adjacency_matrix: The adjacency matrix in SciPy Sparse COOrdinate format.
    """
    # Open file
    file_row_generator = get_file_row_generator(file_path, separator)

    # Initialize lists for row and column sparse matrix arguments
    row = list()
    col = list()
    append_row = row.append
    append_col = col.append

    # Read all file rows
    for file_row in file_row_generator:
        source_node = np.int64(file_row[0])
        target_node = np.int64(file_row[1])

        # Add edge
        append_row(source_node)
        append_col(target_node)

        # Since this is an undirected network also add the reciprocal edge
        append_row(target_node)
        append_col(source_node)

    row = np.array(row, dtype=np.int64)
    col = np.array(col, dtype=np.int64)
    data = np.ones_like(row, dtype=np.float64)

    number_of_nodes = np.max(row)  # I assume that there are no missing nodes at the end.

    # Array count should start from 0.
    row -= 1
    col -= 1

    # Form sparse adjacency matrix
    adjacency_matrix = sparse.coo_matrix((data, (row, col)), shape=(number_of_nodes, number_of_nodes))

    return adjacency_matrix
Reads an edge list in csv format and returns the adjacency matrix in SciPy Sparse COOrdinate format.

    Inputs:  - file_path: The path where the adjacency matrix is stored.
             - separator: The delimiter among values (e.g. ",", "\t", " ")

    Outputs: - adjacency_matrix: The adjacency matrix in SciPy Sparse COOrdinate format.