def get_offsprings(g, nodes):
    """
    Find the offspring nodes in a DAG
    :param g: a directed acyclic graph
    :param nodes: targeted nodes
    :return: a set of offspring nodes
    """
    return set.union(*[g.descendants(d) for d in nodes])