title: find one same element among several object
body: <p>Currently I am doing a work related to polygons. Polygon can be described as several vertices.</p>
  
  <pre><code>struct Polygon{
     vector&lt;Point2D&gt; vertex;
     Color color;
  };
  </code></pre>
  
  <p>Now, I have some polygons already <strong>vector&lt;Polygon> polygons</strong></p>
  
  <p>and a method can tell me that a point is inside which polygon</p>
  
  <pre><code>Polygon queryPolygon(Point2D point);
  </code></pre>
  
  <p>I need to set the color of the returned polygon. </p>
  
  <p><strong>My first question</strong> is how to know whether the returned polygon is inside <strong>vector&lt;Polygon> polygons</strong>, the one I already have.</p>
  
  <p>My first idea is to use <strong>unordered_set</strong> and compare <strong>(vertex.begin(), vertex.end())</strong>. I don't know whether there is any better idea.</p>
  
  <p><strong>Another question</strong> is some polygon might contain the same edge. How to design the data structure so that I can know the polygons that contains same edge like</p>
  
  <pre><code>vector&lt;Polygon&gt; queryPolygonWithSameEdge(Point2D edgeStart, Point2D edgeEnd);
  </code></pre>
  
  <p>of course brute-force is one way, but is there any better ideas?</p>
  
  <p>Thanks.</p>