0
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/subgraph.hpp>

struct service_vertex{
       int    service_id;
       string service_name;
       int    node_id; 
       int    service_status; 
       int    color;
};


struct service_edge {
        string label;
        int color;
        int style;         
};

using Graph_t = boost::adjacency_list{ vecS, vecS, directedS, service_vertex, service_edge};


typedef subgraph<Graph_t> subgraph_t;

subgraph_t subGraph;      //main subgraph

subgraph_t sub1&  = subGraph.create_subgraph();

subgraph_t sub2&  = subGraph.create_subgraph();

auto V1 = add_vertex(service_vertex{...}, sub1);  

auto V2 = add_vertex(service_vertex{...}, sub2);

add_edge(V1, V2, subGraph);

add_vertex() call for subgraph fails, with no matching calls... The subgraph are built based on the node_id in the service_vertex. All services are in one node_id(subgraph). The services in one node_id can be connected to other services in other node_id(subgraph) .

sunder
  • 1
  • 2

0 Answers0