Skip to contents

Formula: R_uv = (e_u - e_v)' L^+ (e_u - e_v), the resistance distance of Klein & Randic (1993), where L = D - A is the graph Laplacian and L^+ its Moore-Penrose inverse.

Usage

Esumtv(G, u, v)

Arguments

G

Symmetric non-negative weight (or 0/1 adjacency) matrix; weights are read as CONDUCTANCES, per Klein & Randic.

u, v

Zero-based node indices in the same component.

Value

List with estimate, resistance, degree_u, degree_v, n, method.

Details

Rather than forming L^+ the linear system is grounded: L is singular with the all-ones vector in its kernel, so deleting row/column v gives a nonsingular matrix, and the solution x of the grounded system against e_u satisfies R_uv = x_u. Exact, and no pseudoinverse is needed.

References

Klein & Randic (1993), Journal of Mathematical Chemistry 12(1):81-95, doi:10.1007/BF01164627.

Examples

Esumtv(matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0), 3, 3), u = 0, v = 1)
#> $estimate
#> [1] 0.6666667
#> 
#> $resistance
#> [1] 0.6666667
#> 
#> $degree_u
#> [1] 2
#> 
#> $degree_v
#> [1] 2
#> 
#> $n
#> [1] 3
#> 
#> $method
#> [1] "Effective resistance between nodes"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"