title: How to find if a vertex exists in a boost graph?
body: <p>I have a boost graph (with bundled properties). I want to find if a vertex with a certain value already exists in the graph or not. Can someone help me with this? Here, I present a MWE of my existing code:</p>
  
  <p><a href="http://coliru.stacked-crooked.com/a/0db95f4b764943a6" rel="noreferrer">Live on Coliru</a></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  #include &lt;boost/graph/adjacency_list.hpp&gt;
  
  struct mytuple
  {
      int e1;
      int e2;
      int s;
  
      bool operator==(const mytuple&amp; a) const
      {
          return ((e1 == a.e1) &amp;&amp; (e2 == a.e2) &amp;&amp; (s == a.s));
      }
  };
  
  struct MyVertex {
      std::string comments;
      int field1;
      mytuple value;
      MyVertex(std::string comments = std::string()) : comments(comments) {}
  };
  
  struct MyEdge {
      std::string label;
      MyEdge(std::string label = std::string()) : label(label) {}
  };
  
  // Define the graph with the vertex as a mytuple and the vertices container as a vector
  using MyTree = boost::adjacency_list&lt;boost::vecS, boost::vecS, boost::bidirectionalS, MyVertex, MyEdge&gt;;
  using Vertex = boost::graph_traits&lt;MyTree&gt;::vertex_descriptor; // Define Vertex
  using VertexItr = boost::graph_traits&lt;MyTree&gt;::vertex_iterator; // Define Vertex iterator
  using Edge = std::pair&lt;boost::graph_traits&lt;MyTree&gt;::edge_descriptor, bool&gt;; // Define Edge
  using EdgeItr = boost::graph_traits&lt;MyTree&gt;::edge_iterator; // Define Edge Iterator
  
  int main()
  {
      MyTree mytree;
  
      Vertex v1 = boost::add_vertex(mytree);
      mytree[v1].value = {1, 1, 1};
  
      Vertex v2 = boost::add_vertex(mytree);
      mytree[v2].value = {2, 2, 2};
  
      Vertex v3 = boost::add_vertex(mytree);
      mytree[v3].value = {3, 3, 3};
  
      // Perhaps add some edges
  
      std::cout &lt;&lt; "I want to find if my graph has a vertex containing the value {1, 1, 1}";
      // mytree.findvertex(with value {1, 1, 1})
  }
  </code></pre>