Returns a set
of set
s, each set of the latter type containing
the location itself and zero or more of its neighbors, if they are connected.
connected_neighbors(neighbors, adjacency_matrix)
A vector of neighbors to a location, the first element of the vector being the specific location, and the other elements its other nearest neighbors. Locations should be encoded as integers.
A boolean matrix, with element \((i,j)\) set to TRUE if location \(j\) is adjacent to location \(i\).
Returns a set
of set
s, each set of the latter type
containing the location itself and zero or more of its neighbors, if they
are connected.