Move EachAdjacentTo() into shared func for undirected.
Move InDegreeOf() into shared function.