Boost logo

Boost :

From: Mark Purtill (purtill_at_[hidden])
Date: 2004-05-07 14:06:54


        The graphviz_write function is inconsistent in how it writes
vertices. When it write the vertex itself, it uses get(vertex_index,
...), but when it writes the edges, it just writes the vertex
descriptor. When using adjacency_list< listS, listS,
bidirectionalS,... >, this produces bad output (the edges list their
endpoints by hexadecimal address values).

        Here's a patch:

*** graphviz.hpp.orig 2004-05-07 12:00:21.000000000 -0700
--- graphviz.hpp 2004-05-07 11:34:11.000000000 -0700
***************
*** 266,272 ****
      }
      typename graph_traits<Graph>::edge_iterator ei, edge_end;
      for(tie(ei, edge_end) = edges(g); ei != edge_end; ++ei) {
! out << source(*ei, g) << Traits::delimiter() << target(*ei, g) << " ";
        epw(out, *ei); //print edge attributes
        out << ";" << std::endl;
      }
--- 266,272 ----
      }
      typename graph_traits<Graph>::edge_iterator ei, edge_end;
      for(tie(ei, edge_end) = edges(g); ei != edge_end; ++ei) {
! out << get(vertex_index, source(*ei, g)) << Traits::delimiter() << get(vertex_index, target(*ei, g)) << " ";
        epw(out, *ei); //print edge attributes
        out << ";" << std::endl;
      }

-- 
^.-.^ Mark Purtill  <mpurtill_at_[hidden]> (425)284-2770
((")) Software Revolution 11332 NE 122nd Way Kirkland WA 98034-6931

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk