我有以下图表类型
typedef boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, PathVertex, PathEdge> GraphStructure;
我插入一些有向边 .
现在,对于每个顶点,我想计算边缘和边缘的数量 .
现在,我发现了m_out_edges结构
GraphStructure xGraph;
add_edge(0, 1, xGraph);
add_edge(1, 2, xGraph);
add_edge(2, 1, xGraph);
int iValue = xGraph.m_vertices.at(0).m_out_edges.size();
但我不知道这是不是我想要的,而且总是存在边缘问题,我现在无法计算 .
因此,给定一个adjacency_list,我如何迭代它的顶点,并分别知道输入边和输出边有多少?
提前感谢您的回复 .