Hi, I use the graph library in some of my programs and I recently moved to boost 1.40 because older version did not work on snow leopard. I noticed that although the changelog does not mention any changes in the graph library, some of the layout algorithms have changes (e.g. random layout and fruchterman reingold) in the way they are called. They seem to use some new topology concept, unfortunately the documentation for those algorithms have not been updated. I was wondering if there is any updated documentation especially on the fruchterman reingold algorithm. I tried to guess what the new parameters mean, but so far I have not been able to get the same results as with the graph library from 1.39. No matter how I set the values so far, all my nodes end up essentially in the same place, although they are all disconnected and I would expect them to be spread out. Thanks a lot Ralph
On Thu, 8 Oct 2009, Ralph Gauges wrote:
Hi,
I use the graph library in some of my programs and I recently moved to boost 1.40 because older version did not work on snow leopard.
I noticed that although the changelog does not mention any changes in the graph library, some of the layout algorithms have changes (e.g. random layout and fruchterman reingold) in the way they are called. They seem to use some new topology concept, unfortunately the documentation for those algorithms have not been updated.
I was wondering if there is any updated documentation especially on the fruchterman reingold algorithm. I tried to guess what the new parameters mean, but so far I have not been able to get the same results as with the graph library from 1.39. No matter how I set the values so far, all my nodes end up essentially in the same place, although they are all disconnected and I would expect them to be spread out.
The new parameters should pretty much match up to the old ones except that the topology parameter allows a more general specification of your output region than a simple width/height pair (allowing more shapes, for example). There could be a bug if your are unable to reproduce the old behavior. What call were you using with the old version? I will try to translate it over so you can test it out. -- Jeremiah Willcock
Jeremiah Willcock wrote:
On Thu, 8 Oct 2009, Ralph Gauges wrote:
Hi,
I use the graph library in some of my programs and I recently moved to boost 1.40 because older version did not work on snow leopard.
I noticed that although the changelog does not mention any changes in the graph library, some of the layout algorithms have changes (e.g. random layout and fruchterman reingold) in the way they are called. They seem to use some new topology concept, unfortunately the documentation for those algorithms have not been updated.
I was wondering if there is any updated documentation especially on the fruchterman reingold algorithm. I tried to guess what the new parameters mean, but so far I have not been able to get the same results as with the graph library from 1.39. No matter how I set the values so far, all my nodes end up essentially in the same place, although they are all disconnected and I would expect them to be spread out.
The new parameters should pretty much match up to the old ones except that the topology parameter allows a more general specification of your output region than a simple width/height pair (allowing more shapes, for example). There could be a bug if your are unable to reproduce the old behavior. What call were you using with the old version? I will try to translate it over so you can test it out.
Thanks for the fast response. In boost prior to 1.40 the called looked like this: boost::fruchterman_reingold_force_directed_layout (this->mGraph, boost::get(vertex_position_t(),this->mGraph), sidelength, sidelength); For now I was restricting the call to a square and the nodes in the graph were all disconnected, so there should only be repulsive forces. Now I tried to do the same thing using a topology; boost::rectangle_topology<> topology(0.0,0.0,sidelength,sidelength); boost::rectangle_topology<>::point_type origin; origin[0]=0.0; origin[1]=0.0; boost::rectangle_topology<>::point_difference_type extent; extent[0]=20.0; // I also tries sidelength instead of 20.0 extent[1]=20.0; boost::fruchterman_reingold_force_directed_layout (this->mGraph, boost::get(vertex_position_t(),this->mGraph), topology, origin, extent ); I guess the topology has the same role as the width and height argument in the older version, but I do not know what "origin" and "extent" since they do not seem to have a correspondence in the old version. I tries to interpret extent as the extend of the area which would actually be redundant information since this is already specified in the topology. Next I thought it might be the width and the height of a node, but changing the values did not seem to make a difference. I also tried to move the origin from 0.0,0.0 to the center of the box etc, but the nodes were always all clustered around the origin with minimal deviations in their position. I also tried to set the attractive and repulsive forces to some constants, but that also did not seem to make a difference in the result. So essentially I just don't know what origin and extent are since the old version did not seem to have corresponding parameters. Thanks a lot Ralph
-- Jeremiah Willcock _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On Thu, 8 Oct 2009, Ralph Gauges wrote:
Jeremiah Willcock wrote:
On Thu, 8 Oct 2009, Ralph Gauges wrote:
Hi,
I use the graph library in some of my programs and I recently moved to boost 1.40 because older version did not work on snow leopard.
I noticed that although the changelog does not mention any changes in the graph library, some of the layout algorithms have changes (e.g. random layout and fruchterman reingold) in the way they are called. They seem to use some new topology concept, unfortunately the documentation for those algorithms have not been updated.
I was wondering if there is any updated documentation especially on the fruchterman reingold algorithm. I tried to guess what the new parameters mean, but so far I have not been able to get the same results as with the graph library from 1.39. No matter how I set the values so far, all my nodes end up essentially in the same place, although they are all disconnected and I would expect them to be spread out.
The new parameters should pretty much match up to the old ones except that the topology parameter allows a more general specification of your output region than a simple width/height pair (allowing more shapes, for example). There could be a bug if your are unable to reproduce the old behavior. What call were you using with the old version? I will try to translate it over so you can test it out.
Thanks for the fast response. In boost prior to 1.40 the called looked like this:
boost::fruchterman_reingold_force_directed_layout (this->mGraph, boost::get(vertex_position_t(),this->mGraph), sidelength, sidelength);
For now I was restricting the call to a square and the nodes in the graph were all disconnected, so there should only be repulsive forces.
Now I tried to do the same thing using a topology; boost::rectangle_topology<> topology(0.0,0.0,sidelength,sidelength); boost::rectangle_topology<>::point_type origin; origin[0]=0.0; origin[1]=0.0; boost::rectangle_topology<>::point_difference_type extent; extent[0]=20.0; // I also tries sidelength instead of 20.0 extent[1]=20.0;
boost::fruchterman_reingold_force_directed_layout (this->mGraph, boost::get(vertex_position_t(),this->mGraph), topology, origin, extent );
I guess the topology has the same role as the width and height argument in the older version, but I do not know what "origin" and "extent" since they do not seem to have a correspondence in the old version. I tries to interpret extent as the extend of the area which would actually be redundant information since this is already specified in the topology. Next I thought it might be the width and the height of a node, but changing the values did not seem to make a difference.
I also tried to move the origin from 0.0,0.0 to the center of the box etc, but the nodes were always all clustered around the origin with minimal deviations in their position.
I also tried to set the attractive and repulsive forces to some constants, but that also did not seem to make a difference in the result.
So essentially I just don't know what origin and extent are since the old version did not seem to have corresponding parameters.
Origin and extent are redundant for the topology you have chosen, but are not in all topologies. Try setting both origin and extent to topology.center() and see if that fixes your issue. -- Jeremiah Willcock
By the way, origin and extent were actually completely unused parameters in many cases, and are now in the topology for the places where they're needed. These changes are in r56654. Could you please try that version out? -- Jeremiah Willcock
Jeremiah Willcock wrote:
By the way, origin and extent were actually completely unused parameters in many cases, and are now in the topology for the places where they're needed. These changes are in r56654. Could you please try that version out?
-- Jeremiah Willcock _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Setting the origin and the extent to the center of the topology did not make any difference. I also tried r56654 and I noticed that the origin and extent parameters to fruchterman reingold have been removed again. After changing the call, I could compile it against the revision 56654, but the result was the same as for boost 1.40 release. All my nodes we placed at almost exactly the same spot. Compiling the same code (just using the old calls to random layout and fruchterman) against boost 1.35 which is the version on my linux box gives me nicely distributed nodes at the edge of the box/topology. Sorry, either I am doing something horribly stupid, or there might be a bug in the reingold algo. Is there anything else, I could do to help locate the problem? Thanks for your help Ralph
On Thu, 8 Oct 2009, Ralph Gauges wrote:
Jeremiah Willcock wrote:
By the way, origin and extent were actually completely unused parameters in many cases, and are now in the topology for the places where they're needed. These changes are in r56654. Could you please try that version out?
-- Jeremiah Willcock _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Setting the origin and the extent to the center of the topology did not make any difference. I also tried r56654 and I noticed that the origin and extent parameters to fruchterman reingold have been removed again. After changing the call, I could compile it against the revision 56654, but the result was the same as for boost 1.40 release. All my nodes we placed at almost exactly the same spot. Compiling the same code (just using the old calls to random layout and fruchterman) against boost 1.35 which is the version on my linux box gives me nicely distributed nodes at the edge of the box/topology.
Sorry, either I am doing something horribly stupid, or there might be a bug in the reingold algo.
Is there anything else, I could do to help locate the problem?
Just to follow up on the list, we did some off-list debugging and a new version of Fruchterman-Reingold is now committed in SVN. -- Jeremiah Willcock
participants (2)
-
Jeremiah Willcock
-
Ralph Gauges