introduce generic parameter for undirected graph's edge