adaptation for undirected networks