Boost logo

Boost Users :

From: Ronald Garcia (garcia_at_[hidden])
Date: 2007-09-18 11:49:42


Hi Brian,

I can see from your code snippet how your are reading the graph in.
Could you show the code for how you are writing the graph out?
I'm not sure if the interface has changed since 1.33.1, but with the
version in CVS, you can pass along the dynamic_properties object and
the name of the property to use for vertex names in order to get the
same graph out:

// Graph structure with dynamic property output
template<typename Graph>
void
write_graphviz(std::ostream& out, const Graph& g,
                const dynamic_properties& dp,
                const std::string& node_id = "node_id");

HTH,
ron

On Sep 17, 2007, at 1:45 PM, Brian Stadler wrote:

> 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_at_[hidden]> wrote:
> On 9/14/07, Brian Stadler <bdotstadler_at_[hidden]> wrote:
> > 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 ;
> > }
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net