upxo.netops.kchar module
Characterise NetworkX grain-neighbour graphs (degree distributions, etc.).
Companion to upxo.netops.kmake (graph build) and
upxo.netops.kcmp (graph comparison) for KREPR / network
representativeness studies.
- upxo.netops.kchar.calculate_kdegrees(networks)[source]
Get degree distribution of every network graph in networks.
- Parameters:
networks (list) – List of networkx network graphs.
- Returns:
kd (list) – List of list of degree of every node in each network graph.
Data structures
—————
networks = [k1, k2, …, kp, … kP] – Where, kp: pth network graph
ks = [k1d, k2d, …, kid, …, knd] – Where, kid: degree distribution of ith network.
kid = [dn1, dn2, …, dnj,… dnJ] – Where, dnj: degree of node j.
- upxo.netops.kchar.calculate_kdegrees_equalbinning(networks)[source]
Calculate the pairwise degree distributions, and equally bin them.
- Parameters:
tgt_graph (networkx graph) – Target graon structure O(n) neighbour network graph.
smp_graph (networkx graph) – Sample graon structure O(n) neighbour network graph.
- Returns:
kd_tgt (List of degree of every node in target network.)
kd_smp (List of degree of every node in sample network.)
Data structures
—————
networks = [k1, k2, …, kp, … kP] – Where, kp: pth network graph
ks = [k1d, k2d, …, kid, …, knd] – Where, kid: degree distribution of ith network.
kid = [dn1, dn2, …, dnj,… dnJ] – Where, dnj: degree of node j.
Explanations
————
Some tests are sensitive to differences in the cumulative
distribution functions (CDFs) of the data. Directly using the raw
degree sequences can be misleading if the sample sizes
(number of nodes) differ significantly between the two networks.
Histograms normalize the data, providing a better representation of
the underlying probability distributions.