Network Science: Connectivity Algorithm
1. Reachability Matrix
1.2 Powers of tadjacency matrix
Powers of the graph adjacency matrix: Computing $#\text{walks} between two nodes
-
\(A_{uv} = 1\) if \(u \in \mathcal{N}(v)\)
-
Let \(P_{uv}^{(K)} = \# \text{walks}\) of length \(K\) between \(u\) and \(v\).
\(P_{uv}^{(K)}\) 表示点 \(u\) 到点 \(v\) 经过 \(K\) 步达到的路径(方案)个数,参考 Floyd 算法。
- \(\mathbf{P}^{(K)} = \mathbf{A}^k\)
Compute \(P_{uv}^{(2)}\):
-
Step 1 : Compute \(\# \text{walk}\) of length 1 between each of \(u\)'s neighbor and \(v\)
-
Step 2 : Sum up these \(\# \text{walks}\) across \(u\)'s neighbors
- \(A^{(P)}_{uv} = \sum \limits_i {A}_{ui} \cdot P_{iv}^{(1)} = \sum \limits_i {A}_{ui} \cdot {A}_{iv} = {A}^2_{u v}\)
Compute \(\#\text{walk}\) between two nodes: use adjacency matrix powers
-
\(A_{uv}\) specifies \(\#\text{walk}\) of length \(1\) (direct neighborhood) between \(u\) and \(v\).
-
\(A_{uv}^{2}\) specifies \(\#\text{walk}\) of length \(2\) (neighbor of neighbor) between \(u\) and \(v\)
-
\(A_{uv}^{l}\) specifies \(\#\text{walk}\) of length \(l\)
1.2 Reachability Matrix
Theorem (On Boolean Adjacency Matrices and Reachability): If \( \mathbf{A}\) is the Boolean adjacency matrix for a directed graph \(G\) with \(n\) nodes and no parallel arcs, then \(\mathbf{A}^{(m)}[i,j]=1\) if and only if there is a path of length \(m\) from node \(n_i\) to node \(n_j\)
We can define a reachability matrix \(\mathbf{R}\) by:
where Then \(n_j\) is reachable from \(n_i\) is and only if entry \(i,j\) in \(\mathbf{R}\) is positive.
2. Components
References:
Binary Relation, Graph Algorithms, site

浙公网安备 33010602011771号