def nonterminal_graph_edge_constraints(new_edges, init_source_side):
    """
    Ensure that the new non-terminal rule respects edge constraints:
        1. No edges should originate from subtracted part of the graph
        2. All edges in the new graph should connect to no more than one distinct node in the subtracted part of the graph
    """

    # Prevent rules with edges starting in the subtracted graph
    if len(set([edge.from_node for edge in new_edges if edge.from_node in init_source_side.nodes])) > 0:
        return False

    # Prevent rules with edges connecting to more than one different node in the subtracted graph
    if len(set([edge.to_node for edge in new_edges if edge.to_node in init_source_side.nodes])) > 1:
        return False

    return True