cartesian {qwalkr} | R Documentation |
Adjacency Matrix of the Cartesian Product
Description
Returns the adjacency matrix of the cartesian product of two graphs
given the adjacency matrix of each one, and
.
Usage
cartesian(G, H = NULL)
Arguments
G |
adjacency matrix of the first graph. |
H |
adjacency matrix of the second graph. If not provided,
it takes the same value as |
Value
Let be the adjacency matrices of
the graphs
such that
and
,
then the adjacency matrix of the cartesian product
is
given by
See Also
Examples
P3 <- matrix(c(0,1,0,1,0,1,0,1,0), nrow=3)
K3 <- matrix(c(0,1,1,1,0,1,1,1,0), nrow=3)
# Return the adjacency matrix of P3 X K3
cartesian(P3, K3)
# Return the adjacency matrix of P3 X P3
cartesian(P3)
[Package qwalkr version 0.1.0 Index]