def connex(data,K,L):
    """
    Return the list of members of the connex component containing the elements
    originaly in L.

    Parameters:
    -----------
    data: pandas dataframe
        data must contain at least one column named neighbors.
    K: list
        The list of members of the connex component so far.
    L: list
        The starting element, then the list of members of the connex component 
        reached so far minus the ones that are in K.

    Returns:
    --------
    K: list
        The junctions in the connex component containing the elements
        originaly in L.
    """
    
    if L == []:
        K.sort()
        return K
    
    M = []
    for elem in L:
        M += data.at[elem,'neighbors_list']
    
    N = []
    for elem2 in M:
        if not (elem2 in K):
            N += [elem2]
            
    N = list(set(N))
    L = N
    K += L
    return connex(data,K,L)