mercredi 26 février 2020

How to extract random subgraph with fixed number of nodes using python networkx?

I have a large graph consisting of ~80k nodes and ~2M nodes (SNAP twitter graph). I want to downsample the graph with n number of nodes picked uniformly randomly (n=~1k), without losing certain properties of the graph (average clustering coefficient and average degree).

I can subgraph in networkx using:

sg = g.subgraph(list_of_nodes)

Is it possible to use networkx to do what I mentioned?




Aucun commentaire:

Enregistrer un commentaire