flag=-1 is used to indicate that the site has not yet been visited. The values 0, 1, ... NBRNUM encode the environment of the atom at each site.
walk() recursively walks over the sites and marks the sites that can be reached by fast steps.
void walk(struct SITE * s, int difEq[]) { int i; s->flag = s->env; if (difEq[s->env]) for (i = 0; i < NBRNUM; i++) if (s->nbr[i]->id == 0 && s->nbr[i]->flag == -1) { swapNbr(s, i); walk(s->nbr[i], difEq); swapNbr(s, i); } }