def extra_edges(x, y):
    """
	Counts edges that are found in the learned structure but are
	not present in the original structure. (lower is better)
	"""
    extra = 0
    for rv in y.nodes():
        if not x.has_node(rv):
            extra += y.degree(rv)
        else:
            for child in y.children(rv):
                if child not in x.children(rv):
                    extra += 1
    return extra
