def incidence_matrix(edges, excpt=[]):
    """Return an incidence matrix as dict where 1 indicates
    a relationship between two nodes in a directed graph.
    
    Parameters
    ----------
    edges: list
        Set of graph's edges
    excpt: list
        Set of nodes to exclude from matrix construction
        (default [])
    """
    I = dict()
    for e in edges:
        a_i = e[0]
        a_j = e[1]
        if (a_i in excpt) | (a_j in excpt):
            continue
        if a_i not in I:
            I[a_i] = dict()
        if a_j not in I[a_i]:
            I[a_i][a_j] = 1
    return I