inline void
    dijkstra_dispatch2
      (const VertexListGraph& g,
       typename graph_traits<VertexListGraph>::vertex_descriptor s, 
       DistanceMap distance, WeightMap weight, IndexMap index_map,
       const Params& params)
    {
      // Default for predecessor map
      dummy_property_map p_map;

      typedef typename property_traits<DistanceMap>::value_type D;
      dijkstra_shortest_paths
        (g, s, 
         choose_param(get_param(params, vertex_predecessor), p_map),
         distance, weight, index_map, 
         choose_param(get_param(params, distance_compare_t()), 
                      std::less<D>()),
         choose_param(get_param(params, distance_combine_t()), 
                      closed_plus<D>()),
         choose_param(get_param(params, distance_inf_t()), 
                      std::numeric_limits<D>::max()),
         choose_param(get_param(params, distance_zero_t()), 
                      D()),
         choose_param(get_param(params, graph_visitor),
                      make_dijkstra_visitor(null_visitor())));
    }
Exemple #2
0
 typename property_traits<CoreMap>::value_type
 weighted_core_numbers(Graph& g, CoreMap c)
 {
     return weighted_core_numbers(
         g,c, make_core_numbers_visitor(null_visitor())
     );
 }
  void breadth_first_visit
    (const IncidenceGraph& g,
     typename graph_traits<IncidenceGraph>::vertex_descriptor s,
     const bgl_named_params<P, T, R>& params)
  {
    // The graph is passed by *const* reference so that graph adaptors
    // (temporaries) can be passed into this function. However, the
    // graph is not really const since we may write to property maps
    // of the graph.
    IncidenceGraph& ng = const_cast<IncidenceGraph&>(g);

    typedef graph_traits<IncidenceGraph> Traits;
    // Buffer default
    typedef typename Traits::vertex_descriptor vertex_descriptor;
    typedef boost::queue<vertex_descriptor> queue_t;
    queue_t Q;
    detail::wrap_ref<queue_t> Qref(Q);

    breadth_first_visit
      (ng, s,
       choose_param(get_param(params, buffer_param_t()), Qref).ref,
       choose_param(get_param(params, graph_visitor),
                    make_bfs_visitor(null_visitor())),
       choose_pmap(get_param(params, vertex_color), ng, vertex_color)
       );
  }
 inline void
 astar_dispatch2
   (VertexListGraph& g,
    typename graph_traits<VertexListGraph>::vertex_descriptor s,
    AStarHeuristic h, CostMap cost, DistanceMap distance,
    WeightMap weight, IndexMap index_map, ColorMap color,
    const Params& params)
 {
   dummy_property_map p_map;
   typedef typename property_traits<CostMap>::value_type C;
   astar_search
     (g, s, h,
      choose_param(get_param(params, graph_visitor),
                   make_astar_visitor(null_visitor())),
      choose_param(get_param(params, vertex_predecessor), p_map),
      cost, distance, weight, index_map, color,
      choose_param(get_param(params, distance_compare_t()),
                   std::less<C>()),
      choose_param(get_param(params, distance_combine_t()),
                   closed_plus<C>()),
      choose_param(get_param(params, distance_inf_t()),
                   std::numeric_limits<C>::max BOOST_PREVENT_MACRO_SUBSTITUTION ()),
      choose_param(get_param(params, distance_zero_t()),
                   C()));
 }
 static void apply
 (VertexListGraph& g,
  typename graph_traits<VertexListGraph>::vertex_descriptor s,
  const bgl_named_params<P, T, R>& params,
  ColorMap color)
 {
   bfs_helper
     (g, s, color,
      choose_param(get_param(params, graph_visitor),
                   make_bfs_visitor(null_visitor())),
      params);
 }
Exemple #6
0
 void
 undirected_dfs(const Graph& g, 
                const bgl_named_params<P, T, R>& params)
 {
   typedef typename get_param_type< vertex_color_t, bgl_named_params<P, T, R> >::type C;
   detail::udfs_dispatch<C>::apply
     (g,
      choose_param(get_param(params, graph_visitor),
                   make_dfs_visitor(null_visitor())),
      choose_param(get_param(params, root_vertex_t()),
                   *vertices(g).first),
      params,
      get_param(params, edge_color),
      get_param(params, vertex_color)
      );
 }
 static void apply
 (VertexListGraph& g,
  typename graph_traits<VertexListGraph>::vertex_descriptor s,
  EdgeType e,
  const bgl_named_params<P, T, R>& params,
  ColorMap color)
 {
   bfs_helper
     (g, s, e, color,
      choose_param(get_param(params, graph_visitor),
                   make_bfs_visitor(null_visitor())),
      params,
      boost::mpl::bool_<
      boost::is_base_and_derived<
      distributed_graph_tag,
      typename graph_traits<VertexListGraph>::traversal_category>::value>());
 }