If I create a graph with cugraph and then calculate position from the nodes or communities, I get a dataframe with information and a vertex id.
So I have three questions:
How is the vertex id created?
Is there a way to merge the output data over the vertex id with the input data?
Is it possible to store the information like in networkx directly in the graph object?
G = cugraph.Graph() G = cugraph.from_cudf_edgelist(edges , source = 'source', destination = 'target') communities = cugraph.louvain(G) pos = cugraph.force_atlas2(G, max_iter=10)
#################################
Answer to 2.
With the help from @Don_A answer and the comments from @BradRees I was able to merge the output data with the input data. The first step is creating a unique nodelist and after that merging it with the output data.
edges = cudf.read_csv('edges.csv')
nodes_source = edges.loc[:, ['Source', 'retweet_author']].rename(columns={"Source": "node", "retweet_author": "author"})
nodes_target = edges.loc[:, ['Target', 'orginal_author']].rename(columns={"Target": "node", "orginal_author": "author"})
node_list = nodes_source.append(nodes_target).drop_duplicates('node')
G = cnx.Graph()
G = cnx.from_cudf_edgelist(edges , source = 'Source', destination = 'Target', edge_attr = 'weight')
communities, modularity_score = cnx.louvain(G)
node_list.merge(communities, left_on="node",right_on="vertex").reset_index()