girvan_newman_null
#
- hypercoil.functional.graph.girvan_newman_null(A: Tensor) Tensor [source]#
Girvan-Newman null model for a tensor block.
The Girvan-Newman null model is defined as the expected connection weight between each pair of vertices if all edges are cut and the resulting stubs then randomly rewired. For the vector of node in-degrees \(k_i \in \mathbb{R}^I\), vector of node out-degrees \(k_o \in \mathbb{R}^O\), and total edge weight \(2m \in \mathbb{R}\), this yields the null model
\(P_{GN} = \frac{1}{2m} k_i k_o^\intercal\)
or, in terms of the adjacency matrix \(A \in \mathbb{R}^{I \times O}\)
\(P_{GN} = \frac{1}{\mathbf{1}^\intercal A \mathbf{1}} A \mathbf{1} \mathbf{1}^\intercal A\)
- Dimension:
- Input : \((N, *, I, O)\)
N denotes batch size,
*
denotes any number of intervening dimensions, I denotes number of vertices in the source set and O denotes number of vertices in the sink set. If the same set of vertices emits and receives edges, then \(I = O\).- Output : \((N, *, I, O)\)
As above.
- Parameters:
- ATensor
Block of adjacency matrices for which the quantity of interest is to be computed.
- Returns:
- PTensor
Block comprising Girvan-Newman null matrices corresponding to each input adjacency matrix.