Created
March 20, 2024 11:02
-
-
Save ArthurDelannoyazerty/34da5feab27ad8d4b4f1eea5498d130e to your computer and use it in GitHub Desktop.
Print stats of a networkX graph.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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