Return those elements in the second set \(Z_1\) which are connected to those in the first set \(Z_0\), according to the adjacency matrix.
connected_to(Z_0, Z_1, adjacency_matrix)
A set of locations, given as integers.
A set of locations, given as integers.
A boolean matrix, with element \((i,j)\) set to TRUE if location \(j\) is adjacent to location \(i\).
A set, possibly empty, containing those locations in \(Z_1\) that are connected to any of the locations in \(Z_0\).