目前,我有一个图表,我vertices通过. 因此,每当我需要访问标签属性时,我都会在地图中找到标签并获取.labelsexternal mapmapped vertex
/// vertex properties
struct VertexData
{
std::string label;
int num;
};
/// edges properties
struct EdgeData
{
std::string edge_name;
double edge_confidence;
};
/// define the boost-graph
typedef boost::adjacency_list<boost::vecS, boost::vecS,
boost::bidirectionalS,
boost::property<boost::edge_index_t , size_t , VertexData>,
boost::property<boost::edge_weight_t, double, EdgeData> > Graph;
/// define vertexMap
std::map<std::string, vertex_t> vertexMap;
///loop through the vertices to make the vertexMap here ...
vertexMap.insert(std::pair<std::string, vertex_t> (label, v));
/// find any label in the map and access the corresponding …Run Code Online (Sandbox Code Playgroud)