algorithm - Fast Convertion From Adjacency List to Edge List -
i have undirected weighted graph implemented adjacency list need convert edge list. problem is, each edge (a, b)
, have 2 entries in adjacency list: 1 indicating edge b , other b. so, while converting edge list, need search whole partially completed edge list prevent duplicates.
is there way can make faster/ less complicated? need keep adjacency list because algorithm of detecting cycles in graph relies on it.
enumerate vertices add list edges (u, v)
such u <= v
.
Comments
Post a Comment