def ged_from_adj(adj_mat_1, adj_mat_2, directed=False, ged_function=graph_edit_dist.compare):
    'Calculate the graph edit distance between two graphs'
    if directed:
        create_using = nx.DiGraph
    else:
        create_using = nx.Graph
    g1 = nx.from_numpy_matrix(adj_mat_1, create_using=create_using())
    g2 = nx.from_numpy_matrix(adj_mat_2, create_using=create_using())
    return ged_function(g1, g2)
Calculate the graph edit distance between two graphs
def ged_from_adj(adj_mat_1, adj_mat_2, directed=False, ged_function=graph_edit_dist.compare):
    
    if directed:
        create_using = nx.DiGraph
    else:
        create_using = nx.Graph
    g1 = nx.from_numpy_matrix(adj_mat_1, create_using=create_using())
    g2 = nx.from_numpy_matrix(adj_mat_2, create_using=create_using())
    return ged_function(g1, g2)