[Boost-bugs] [Boost C++ Libraries] #4447: brandes betweenness crashes when there are more than 45 nodes involved

Subject: [Boost-bugs] [Boost C++ Libraries] #4447: brandes betweenness crashes when there are more than 45 nodes involved
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-07-16 11:28:50


#4447: brandes betweenness crashes when there are more than 45 nodes involved
----------------------------------------------------------+-----------------
 Reporter: jan-oliver1.janda@… | Owner: asutton
     Type: Bugs | Status: new
Milestone: Boost 1.44.0 | Component: graph
  Version: Boost 1.44.0 | Severity: Problem
 Keywords: brandes betweeness |
----------------------------------------------------------+-----------------
 brandes betweenness crashes when there are more than 45 nodes involved.
 see the following code:

 void calcBetweeness()
     {
     typedef boost::adjacency_list<boost::vecS, boost::vecS,
 boost::undirectedS>
             Graph;
     typedef boost::graph_traits<Graph>::vertex_descriptor Vertex;
     typedef boost::graph_traits<Graph>::vertex_iterator Vertex_Iter;
     typedef boost::graph_traits<Graph>::edge_descriptor Edge;
     typedef boost::graph_traits<Graph>::edge_iterator Edge_Iter;
     typedef boost::property_map<Graph, boost::vertex_name_t>::type
 Name_Map_t;
     typedef boost::property_map<Graph, boost::edge_index_t>::type
 Edge_Map_t;

     int n_vrtx = 46;
     Graph g_star(n_vrtx);
     for (int i = 4; i < n_vrtx; ++i)
         {
         add_edge(vertex(0, g_star), vertex(i, g_star), g_star);
         add_edge(vertex(1, g_star), vertex(i, g_star), g_star);
         add_edge(vertex(2, g_star), vertex(i, g_star), g_star);
         add_edge(vertex(3, g_star), vertex(i, g_star), g_star);
         }

     Vertex_Iter vertex_iterator_begin, vertex_iterator_end;

     std::vector<double> centrality(n_vrtx);
     boost::brandes_betweenness_centrality(g_star, boost::centrality_map(
             boost::make_iterator_property_map(centrality.begin(), get(
                     boost::vertex_index, g_star))));

     for (tie(vertex_iterator_begin, vertex_iterator_end) =
 vertices(g_star); vertex_iterator_begin
             != vertex_iterator_end; ++vertex_iterator_begin)
         {
         cout << "Vertex: " << *vertex_iterator_begin << "\tBC: "
                 << centrality[*vertex_iterator_begin] << endl;
         }
     return;
     }

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4447>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:03 UTC