Attempts to create a graph object from a matrix, with nodes representing cells and edges representing adjacency. I've taken this partially from StackExchange but it seems very unefficient

GfM(mat, np = 1)

Arguments

mat

Matrix representing the initial habitat state.

np

Number of cores for parallel processing.

Value

Graph object corresponding to the input matrix.