Пример #1
0
 bool operator()(CorrespondenceMap1To2 f, CorrespondenceMap2To1) const {
   
   // Print (sub)graph isomorphism map
   BGL_FORALL_VERTICES_T(v, graph1_, Graph1) 
     std::cout << '(' << get(vertex_index_t(), graph1_, v) << ", " 
               << get(vertex_index_t(), graph1_, get(f, v)) << ") ";
   
   std::cout << std::endl;
   
   return true;
 }
Пример #2
0
  inline void write_graphviz(std::ostream& out, const Graph& g,
                             VertexPropertiesWriter vpw,
                             EdgePropertiesWriter epw,
                             GraphPropertiesWriter gpw)
  {
    typedef typename property_map<Graph, vertex_index_t>::const_type vimap_t;
    vimap_t vertex_index = get(vertex_index_t(), g);
    typedef typename graph_traits<Graph>::directed_category cat_type;
    typedef graphviz_io_traits<cat_type> Traits;
    std::string name = "G";
    out << Traits::name() << " " << name << " {" << std::endl;

    gpw(out); //print graph properties

    typename graph_traits<Graph>::vertex_iterator i, end;

    for(tie(i,end) = vertices(g); i != end; ++i) {
      out << get(vertex_index, *i);
      vpw(out, *i); //print vertex attributes
      out << ";" << std::endl;
    }
    typename graph_traits<Graph>::edge_iterator ei, edge_end;
    for(tie(ei, edge_end) = edges(g); ei != edge_end; ++ei) {
      out << get(vertex_index, source(*ei, g)) << Traits::delimiter() << get(vertex_index, target(*ei, g)) << " ";
      epw(out, *ei); //print edge attributes
      out << ";" << std::endl;
    }
    out << "}" << std::endl;
  }
Пример #3
0
 std::list<std::pair<typename property_map<Graph, edge_weight_t>::value_type,
                     std::list<Edge<Graph>>>>
 yen_ksp(const Graph& g, Vertex<Graph> s, Vertex<Graph> t,
         boost::optional<unsigned> K = boost::optional<unsigned>(),
         boost::optional<unsigned> length = boost::optional<unsigned>())
 {
   return yen_ksp(g, s, t, get(edge_weight_t(), g),
                  get(vertex_index_t(), g), K);
 }