Skip to content

Instantly share code, notes, and snippets.

@ArthurDelannoyazerty
Created March 20, 2024 11:02
Show Gist options
  • Save ArthurDelannoyazerty/34da5feab27ad8d4b4f1eea5498d130e to your computer and use it in GitHub Desktop.
Save ArthurDelannoyazerty/34da5feab27ad8d4b4f1eea5498d130e to your computer and use it in GitHub Desktop.
Print stats of a networkX graph.
from networkx import Graph
def print_graph_summary(graph:Graph):
nb_node = graph.number_of_nodes()
nb_edge = graph.number_of_edges()
print("Number of nodes : ", nb_node, "Number of edges : ", nb_edge)
return nb_node, nb_edge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment