title: Fast Convertion From Adjacency List to Edge List
body: <p>I have an undirected weighted graph implemented with adjacency list which I need to convert to an edge list. The problem is, for each edge <code>(A, B)</code>, I have two entries in adjacency list: one indicating an edge to B from A and other from A to B. So, while converting this to edge list, I need to search the whole partially completed edge list to prevent duplicates.</p>
  
  <p>Is there any way I can make that faster/ less complicated? I need to keep the adjacency list because my algorithm of detecting cycles in graph relies on it. </p>