I'm new to R and want to construct a regular lattice with 30 nodes and k=4 (neighborhood connectivity).
I've tried the igraph package with graph.lattice function, but cannot produce what I'm looking for.
I'm new to R and want to construct a regular lattice with 30 nodes and k=4 (neighborhood connectivity).
I've tried the igraph package with graph.lattice function, but cannot produce what I'm looking for.
A regular lattice in iGraph with k = 4 neighbourhood connectivity:
require(igraph)
g <- graph.lattice( c(5,6) )
g <- connect.neighborhood(g, 4)
plot(g)