CreateGrid: Generate a grid-like network

Description Usage Arguments Details Value Author(s) Examples

View source: R/CreateGrid.R

Description

Generate a network with a grid-like arrangement of edges.

Usage

1
CreateGrid(n=100)

Arguments

n

Integer value, the number of vertices to be included.

Details

This is a simple algorithm that creates a grid-like network. Vertices are arranged in the largest square lattice possible. Vertices not included within this square are added as an additional row. Vertices are connected by edges to their closest neighbours.

Value

igraph object.

Author(s)

Alex J. Cornish a.cornish12@imperial.ac.uk

Examples

1
2
3
# generate and plot a grid-like network containing 100 vertices. 
g <- CreateGrid(n = 100)
plot(g, layout=layout.fruchterman.reingold)

Example output

Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

SANTA documentation built on Oct. 31, 2019, 3:21 a.m.

Related to CreateGrid in SANTA...