-
Notifications
You must be signed in to change notification settings - Fork 117
Open
Description
i have found the below a little helpful in weeding out graphs with the same degree set
def add_adjacency(G, add_itself):
for node in list(G.nodes): total = 0
for adj_node in list(G.adj[node]): total = total + G.degree[adj_node]
if add_itself: G.nodes[node]['adj_degree'] = total + G.degree(node)
else: G.nodes[node]['adj_degree'] = total
def extract_node_info(G): thislist = []
for data in G.nodes.data(): for dicto in data:
if isinstance(dicto, dict): # don't call it dict call it dicto thislist.append(dicto['adj_degree'])
`` return thislist
but is not effective in all cases

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels