Problem in cal diameter and girth using BGL
Hi...
I want to calculate diameter and girth of a graph using BGL so i m taking
http://www.cs.ualberta.ca/~ghali/courses/texts/BGL/html/girth.cpp.html#pred_...
as a reference.
I have already created graph using adjacency_list
Now i m not able to understand how to use :-
typedef boost::v_property<long> dist_t;
boost::property_map
On Sep 20, 2007, at 6:59 AM, tonyaim83 wrote:
I want to calculate diameter and girth of a graph using BGL so i m taking
http://www.cs.ualberta.ca/~ghali/courses/texts/BGL/html/ girth.cpp.html#pred_t.54 as a reference. I have already created graph using adjacency_list
Now i m not able to understand how to use :-
typedef boost::v_property<long> dist_t; boost::property_map
::type d_map; typedef boost::u_property
pred_t; boost::property_map ::type p_map;
Those are Stanford GraphBase-specific property maps. You can create your own property maps from the adjacency_list; see http:// www.boost.org/libs/graph/doc/using_property_maps.html
Is there any alternative to calculate diameter and girth
We don't have these functions in the BGL at this time. - Doug
Hi
I m able to calculate the diameter of a graph using BFS visitor. I got all
the distances and then i m finding out the maximum using the following to
get the diameter ..
template <class Distance>class calc_distance_visitor : public
boost::bfs_visitor<>
{
public:
calc_distance_visitor(Distance d,std::size_t& girth) :
distance(d),Girth(girth)
{
}
template <class Graph>
void tree_edge(typename boost::graph_traits<Graph>::edge_descriptor
e,Graph& g)
{
Vertex u, v;
u = boost::source(e, g);
v = boost::target(e, g);
distance[v] = distance[u] + 1;
}
};
and then
typedef std::vector
On Sep 20, 2007, at 6:59 AM, tonyaim83 wrote:
I want to calculate diameter and girth of a graph using BGL so i m taking
http://www.cs.ualberta.ca/~ghali/courses/texts/BGL/html/ girth.cpp.html#pred_t.54 as a reference. I have already created graph using adjacency_list
Now i m not able to understand how to use :-
typedef boost::v_property<long> dist_t; boost::property_map
::type d_map; typedef boost::u_property
pred_t; boost::property_map ::type p_map; Those are Stanford GraphBase-specific property maps. You can create your own property maps from the adjacency_list; see http:// www.boost.org/libs/graph/doc/using_property_maps.html
Is there any alternative to calculate diameter and girth
We don't have these functions in the BGL at this time.
- Doug _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- View this message in context: http://www.nabble.com/Problem-in-cal-diameter-and-girth-using-BGL-tf4486815.... Sent from the Boost - Users mailing list archive at Nabble.com.
participants (2)
-
Doug Gregor
-
tonyaim83