title: algorithm to find edges using vertices (2D and 3D) in a mesh
body: <p>I have a a mesh, with certain types of elements (e.g. triangular, tetra). For each element I know all its vertices i.e. a triangular 2D element will have 3 vertices v1, v2 and v3 whose x,y,z coords are known. </p>
  
  <p><strong>Question 1</strong></p>
  
  <p>I am looking for an algorithm that will return all the edges... in this case:</p>
  
  <p>edge(v1, v2), edge(v1, v3) , edge(v2, v3).  Based on how many vertices each element has , the algorithm should efficiently determine the edges.</p>
  
  <p><strong>Question 2</strong></p>
  
  <p>I am using C++, so, what will be the most efficient way to store the information about the edges returned by the above algorithm? Example, all I am interested in is a tuple (v1, v2) that I want to use for some computation and then forget about it. </p>
  
  <p>Thank you</p>