probinet.input.stats#

It is designed to compute and print statistical information about NetworkX graphs. The script calculates metrics such as the number of nodes, layers, edges, average degree, weighted degree, reciprocity, and more. It aims to provide a comprehensive overview of the structural properties of the input graphs, considering both directed and weighted edges.

Functions

print_graph_stats(G[, rw])

Print the statistics of the graph G.

print_graph_stats_MTCOV(A)

Print the statistics of the graph A.

reciprocal_edges(G)

Compute the proportion of bi-directional edges, by considering the unordered pairs.

probinet.input.stats.print_graph_stats(G: List[MultiDiGraph], rw: List[float] | None = None) None[source]#

Print the statistics of the graph G.

This function calculates and prints various statistics of the input graph such as the number of edges, average degree in each layer, sparsity, and reciprocity. If the weights of the edges are provided, it also calculates and prints the reciprocity considering the weights of the edges.

Parameters:
  • G (list) – List of MultiDiGraph NetworkX objects representing the layers of the graph.

  • rw (list, optional) – List of floats representing the weights of the edges in each layer of the graph. If not provided, the function will consider the graph as unweighted.

probinet.input.stats.print_graph_stats_MTCOV(A: List[MultiDiGraph]) None[source]#

Print the statistics of the graph A.

Parameters:

A (list) – List of MultiGraph (or MultiDiGraph if undirected=False) NetworkX objects.

probinet.input.stats.reciprocal_edges(G: MultiDiGraph) float[source]#

Compute the proportion of bi-directional edges, by considering the unordered pairs.

Parameters:

G (MultiDigraph) – MultiDiGraph NetworkX object.

Returns:

reciprocity – Reciprocity value, intended as the proportion of bi-directional edges over the unordered pairs.

Return type:

float