implement neighborhoods of whole graph