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)
Matrix representing the initial habitat state.
Number of cores for parallel processing.
Graph object corresponding to the input matrix.