Skip to contents

The walks are counted on the direct product graph, whose adjacency is the Kronecker product A1 (x) A2: a walk there is a pair of walks, one in each graph, of equal length. Convergence needs lam below 1 / (rho(A1) rho(A2)), a much tighter constraint than the single-graph case.

Usage

RandW(G1, G2, lam = 0.05)

Arguments

G1

Square adjacency matrix of the first graph.

G2

Square adjacency matrix of the second graph.

lam

Discount factor, positive.

Value

List with estimate, trace, n1, n2.

Details

Formula: k(G1, G2) = sum_ij [(I - lam (A1 (x) A2))^{-1}]_ij.

References

Gaertner, T., Flach, P. & Wrobel, S. (2003). On graph kernels: hardness results and efficient alternatives. Learning Theory and Kernel Machines, LNCS 2777, pages 129-143. doi:10.1007/978-3-540-45167-9_11 .

Examples

RandW(G1 = 5L, G2 = 5L)
#> $estimate
#> [1] -4
#> 
#> $trace
#> [1] -4
#> 
#> $n1
#> [1] 1
#> 
#> $n2
#> [1] 1
#> 
#> $method
#> [1] "Direct-product random-walk graph kernel"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"