where \(F(t)\) is the quality matrix and \(v_k\) are null model vectors.
In the following we denote by \(A\) the adjacency matrix of a graph with \(N\) nodes and
\(M\) edges. The out-degree of the graph is given by \(d=A\boldsymbol{1}\), where
\(\boldsymbol{1}\) is the vector of ones, and we denote the diagonal degree matrix by
\(D=\mathrm{diag}(d)\).
Parent class for generalized Markov Stability constructor.
This class encodes generalized Markov Stability through the quality matrix and null models.
Use the method prepare to load and compute scale independent quantities, and the method get_data
to return quality matrix, null model, and possible global shift.
The constructor calls the prepare method upon initialisation.
Parameters:
graph (csgraph) – graph for which to run clustering
with_spectral_gap (bool) – set to True to use spectral gap to rescale
kwargs (dict) – any other properties to pass to the constructor.
exp_comp_mode (str) – mode to compute matrix exponential, can be expm or spectral
Constructor for continuous combinatorial Markov Stability.
This implementation follows equation (16) in [1]. The quality matrix is:
\[F(t) = \Pi\exp(-tL/<d>)\]
where \(<d>=(\boldsymbol{1}^T D \boldsymbol{1})/N\) is the average degree,
\(L=D-A\) is the combinatorial Laplacian and \(\Pi=\mathrm{diag}(\pi)\),
with null model \(v_1=v_2=\pi=\frac{\boldsymbol{1}}{N}\).
References
The constructor calls the prepare method upon initialisation.
Parameters:
graph (csgraph) – graph for which to run clustering
with_spectral_gap (bool) – set to True to use spectral gap to rescale
kwargs (dict) – any other properties to pass to the constructor.
exp_comp_mode (str) – mode to compute matrix exponential, can be expm or spectral
This implementation is equation (18) of [2], where quality is the adjacency matrix and
the null model is the difference between the standard modularity null models based on
positive and negative degree vectors.
References
The constructor calls the prepare method upon initialisation.
Parameters:
graph (csgraph) – graph for which to run clustering
with_spectral_gap (bool) – set to True to use spectral gap to rescale
kwargs (dict) – any other properties to pass to the constructor.
exp_comp_mode (str) – mode to compute matrix exponential, can be expm or spectral
Constructor for continuous signed combinatorial Markov Stability.
This implementation follows equation (19) in [3]. The quality matrix is:
\[F(t) = \exp(-tL)^T\exp(-tL)\]
where \(L=D_{\mathrm{abs}}-A\) is the signed combinatorial Laplacian,
\(D_{\mathrm{abs}}=\mathrm{diag}(d_\mathrm{abs})\) the diagonal matrix of absolute node
strengths \(d_\mathrm{abs}\), and the associated null model is given by
\(v_1=v_2=\boldsymbol{0}\), where \(\boldsymbol{0}\) is the vector of zeros.
References
The constructor calls the prepare method upon initialisation.
Parameters:
graph (csgraph) – graph for which to run clustering
with_spectral_gap (bool) – set to True to use spectral gap to rescale
kwargs (dict) – any other properties to pass to the constructor.
exp_comp_mode (str) – mode to compute matrix exponential, can be expm or spectral
where \(I\) denotes the identity matrix, \(M(\alpha)\) is the transition matrix of a
random walk with teleportation and damping factor \(0\le \alpha < 1\), and
\(\Pi=\mathrm{diag}(\pi)\) for the associated null model \(v_1=v_2=\pi\) given by the
eigenvector solving \(\pi M(\alpha) = \pi\), which is related to PageRank. See [1] for
details.
where \(D\) denotes the diagonal matrix of out-degrees with \(D_{ii}=1\) if the
out-degree \(d_i=0\) and \(a\) denotes the vector of dangling nodes, i.e. \(a_i=1\)
if the out-degree \(d_i=0\) and \(a_i=0\) otherwise.
The constructor calls the prepare method upon initialisation.
Parameters:
graph (csgraph) – graph for which to run clustering
with_spectral_gap (bool) – set to True to use spectral gap to rescale
kwargs (dict) – any other properties to pass to the constructor.
exp_comp_mode (str) – mode to compute matrix exponential, can be expm or spectral
Constructor for linearized directed Markov stability.
The quality matrix is:
\[F(t)=\Pi t M(\alpha)\]
where \(M(\alpha)\) is the transition matrix of a random walk with teleportation and
damping factor \(0\le \alpha < 1\), and \(\Pi=\mathrm{diag}(\pi)\) for the associated
null model \(v_1=v_2=\pi\) given by the eigenvector solving \(\pi M(\alpha) = \pi\),
which is related to PageRank.
where \(I\) denotes the identity matrix, \(D\) denotes the diagonal matrix of
out-degrees with \(D_{ii}=1\) if the out-degree \(d_i=0\) and \(a\) denotes the
vector of dangling nodes, i.e. \(a_i=1\) if the out-degree \(d_i=0\) and \(a_i=0\)
otherwise.
The constructor calls the prepare method upon initialisation.
Parameters:
graph (csgraph) – graph for which to run clustering
with_spectral_gap (bool) – set to True to use spectral gap to rescale
kwargs (dict) – any other properties to pass to the constructor.
exp_comp_mode (str) – mode to compute matrix exponential, can be expm or spectral