Skip to content

isomorphism guide #154

@gilderdeegee-ship-it

Description

@gilderdeegee-ship-it

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

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions