def filter_adjlist(adjlist, focal_col="focal", neighbor_col="neighbor"):
    """
    This dedupes an adjacency list by examining both (a,b) and (b,a) when (a,b) is enountered.
    The removal is done in order of the iteration order of the input adjacency list. So, if a 
    special order of removal is desired, you need to sort the list before this function. 

    Parameters
    ----------
    adjlist     :   pandas DataFrame
                    a dataframe that contains focal and neighbor columns
    focal_col   :   string
                    the name of the column with the focal observation id
    neighbor_col:   string
                    the name of the column with the neighbor observation id

    Returns
    -------
    an adjacency table with reversible entries removed. 
    """
    edges = adjlist.loc[:, [focal_col, neighbor_col]]
    undirected = set()
    to_remove = []
    for index, *edge in edges.itertuples(name=None):
        edge = tuple(edge)
        if edge in undirected or edge[::-1] in undirected:
            to_remove.append(index)
        else:
            undirected.add(edge)
            undirected.add(edge[::-1])
    adjlist = adjlist.drop(to_remove)
    return adjlist