MCPcopy
hub / github.com/shenweichen/GraphEmbedding / preprocess_nxgraph

Function preprocess_nxgraph

ge/utils.py:1–9  ·  view source on GitHub ↗
(graph)

Source from the content-addressed store, hash-verified

1def preprocess_nxgraph(graph):
2 node2idx = {}
3 idx2node = []
4 node_size = 0
5 for node in graph.nodes():
6 node2idx[node] = node_size
7 idx2node.append(node)
8 node_size += 1
9 return idx2node, node2idx
10
11
12def partition_dict(vertices, workers):

Callers 3

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected