title: How to print a graph in graphviz with multiple properties displayed
body: <p>My question is based off of: <a href="https://stackoverflow.com/questions/9181183/how-to-print-a-boost-graph-in-graphviz-with-one-of-the-properties-displayed">How to print a graph with a single property displayed</a></p>
  
  <p>I am using bundled properties: </p>
  
  <pre><code> typedef struct vert{
     std::string name;
   };
  
   typedef struct edge{
     int capacity;
     int weight;
   }; 
  
  typedef adjacency_list&lt;listS, vecS, undirectedS, vert, edge&gt; Graph;
  Graph g;
  vector&lt;int,int&gt; ele;
  </code></pre>
  
  <p>I have the following called in a loop that <em>should</em> create the edges:</p>
  
  <pre><code>  edge prop;
    prop.weight = 5;
    prop.capacity = 4;
    add_edge(ele.first,ele.second, prop, g);
  </code></pre>
  
  <p>This segment is what prints the graph to dot format.</p>
  
  <pre><code>ofstream dot("graph.dot");
  write_graphviz(dot, g, 
    boost::make_label_writer(boost::get(&amp;vert::name, g)),
    boost::make_label_writer(boost::get(&amp;edge::weight, g)),
    boost::make_label_writer(boost::get(&amp;edge::capacity, g)));
  </code></pre>
  
  <p>The error is:</p>
  
  <pre><code>/usr/include/boost/graph/graphviz.hpp: In function ‘void boost::write_graphviz(std::ostream&amp;, const Graph&amp;, VertexPropertiesWriter, EdgePropertiesWriter, GraphPropertiesWriter, VertexID) [with Graph = boost::adjacency_list&lt;boost::listS, boost::vecS, boost::undirectedS, vert, edge, boost::no_property, boost::listS&gt;, VertexPropertiesWriter = boost::label_writer&lt;boost::bundle_property_map&lt;boost::adjacency_list&lt;boost::listS, boost::vecS, boost::undirectedS, vert, edge, boost::no_property, boost::listS&gt;, long unsigned int, vert, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt;, EdgePropertiesWriter = boost::label_writer&lt;boost::bundle_property_map&lt;boost::adjacency_list&lt;boost::listS, boost::vecS, boost::undirectedS, vert, edge, boost::no_property, boost::listS&gt;, boost::detail::edge_desc_impl&lt;boost::undirected_tag, long unsigned int&gt;, edge, int&gt; &gt;, GraphPropertiesWriter = boost::label_writer&lt;boost::bundle_property_map&lt;boost::adjacency_list&lt;boost::listS, boost::vecS, boost::undirectedS, vert, edge, boost::no_property, boost::listS&gt;, boost::detail::edge_desc_impl&lt;boost::undirected_tag, long unsigned int&gt;, edge, int&gt; &gt;, VertexID = boost::vec_adj_list_vertex_id_map&lt;boost::property&lt;boost::vertex_bundle_t, vert, boost::no_property&gt;, long unsigned int&gt;]’:
  /usr/include/boost/graph/graphviz.hpp:260:   instantiated from ‘void boost::write_graphviz(std::ostream&amp;, const Graph&amp;, VertexPropertiesWriter, EdgePropertiesWriter, GraphPropertiesWriter) [with Graph = Graph, VertexPropertiesWriter = boost::label_writer&lt;boost::bundle_property_map&lt;boost::adjacency_list&lt;boost::listS, boost::vecS, boost::undirectedS, vert, edge, boost::no_property, boost::listS&gt;, long unsigned int, vert, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt;, EdgePropertiesWriter = boost::label_writer&lt;boost::bundle_property_map&lt;boost::adjacency_list&lt;boost::listS, boost::vecS, boost::undirectedS, vert, edge, boost::no_property, boost::listS&gt;, boost::detail::edge_desc_impl&lt;boost::undirected_tag, long unsigned int&gt;, edge, int&gt; &gt;, GraphPropertiesWriter = boost::label_writer&lt;boost::bundle_property_map&lt;boost::adjacency_list&lt;boost::listS, boost::vecS, boost::undirectedS, vert, edge, boost::no_property, boost::listS&gt;, boost::detail::edge_desc_impl&lt;boost::undirected_tag, long unsigned int&gt;, edge, int&gt; &gt;]’
  file_format.cc:194:   instantiated from here
  /usr/include/boost/graph/graphviz.hpp:236: error: no match for call to ‘(boost::label_writer&lt;boost::bundle_property_map&lt;boost::adjacency_list&lt;boost::listS, boost::vecS, boost::undirectedS, vert, edge, boost::no_property, boost::listS&gt;, boost::detail::edge_desc_impl&lt;boost::undirected_tag, long unsigned int&gt;, edge, int&gt; &gt;) (std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp;)’
  </code></pre>
  
  <p>It is strange to me because this works:</p>
  
  <pre><code>write_graphviz(dot, g,
    boost::make_label_writer(boost::get(&amp;vert_info::name, g)));
  </code></pre>
  
  <p>and outputs the following:</p>
  
  <pre><code>graph G {
  0[label="0"];
  1[label="1"];
  2[label="2"];
  3[label="3"];
  4[label="4"];
  5[label="5"];
  6[label="6"];
  7[label="7"];
  8[label="8"];
  9[label=""];  // this is another problem that I will have to fix but beside the point
  0--9 ;
  0--5 ;
  0--2 ;
  0--1 ;
  ...
  ...
  }
  </code></pre>
  
  <p>My goal is to have each node labeled, and each edge labelled with its capacity and weight.</p>