Good observation.  I see exactly what it's doing now.

However, this is still a bug.  If one is using dot language files across different programs then the parser needs to interpret it the same.  Though the graph may retain its overall structure, the structure for that individual vertex has now changed.  This will adversely affect the way algorithms make entree into the graph.  For example, if vertex 0 once had a degree of two and now has a degree of 3 than the choices to move from 0 have changed from two choices to three.

thanks again for the response!

On 9/17/07, Krishna Roskin <krish@soe.ucsc.edu> wrote:
On 9/14/07, Brian Stadler <bdotstadler@gmail.com> wrote:
> I'm reading in thousands of files in the graphviz language into a program
> using read_graphviz(), library version 1.33.1.  I noticed a problem with
> some of my results and discovered that read_graphviz doesn't appear to be
> interpreting the files correctly.  The structure of the graphs is preserved
> (no edges gone astray).  However, the labeling of the nodes is changed.  I
> confirmed this by reading in a file and immediately writing it back out
> using write_graphviz().  Below is the code used to read in the files.  It's
> very simple as I have nothing special being reprsented.  Could someone else
> check this and confirm this is a problem.  I've checked the bugs list and
> 1.34.x release notes and found nothing addressing the particular issue.
>
> thanks all.
>
> My read_graphviz code:
>
> bool file;
> ifstream in(openfile.c_str(), ios::in);
> dynamic_properties dp;
> dp.property ("node_id", get(&ed_node::vertex_name, ug));  <--simple
> adjacency list with bundled properties being used
> file = read_graphviz(in, ug, dp, "node_id");
>
> Source graphviz file:
>
> strict graph  {
>     0 -- 3;
>     0 -- 4;
>     1 -- 3;
>     1 -- 4;
>     2 -- 3;
>     2 -- 4;
>     3 -- 4;
> }
>
> Output graphviz file:
>
> graph G {
> 0;
> 1;
> 2;
> 3;
> 4;
> 0--1 ;
> 0--2 ;
> 3--1 ;
> 3--2 ;
> 4--1 ;
> 4--2 ;
> 1--2 ;
> }

It looks like read_graphviz just adds the vertices in the order they
appear in the graph. That's why they get the above vertex indices. My
code does this all the time so I just learned to live with it. If I
really care about the vertex names, I add them to the graphviz file
with [label="name"] and not count on the vertex index.

HTH,
-krish
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users