내가 프로젝트에서 그래프 라이브러리 부스트 사용 부스트 adjacency_list에와 connected_components을 수행하고 그것으로 선언한다 : 내 그래프에 connected_components를 호출 할 때까지는 그러나 VertexList = 목록을
typedef adjacency_list <listS, listS, undirectedS, TrackInformation, LinkInformation> TracksConnectionGraph;
상황이 좋은 것입니다.
typedef std::map<TracksConnectionGraph::vertex_descriptor, TracksConnectionGraph::vertices_size_type> component_type;
component_type component;
boost::associative_property_map<component_type> component_map(component);
int num_components = connected_components(tracks_connection_graph_, component_map);
문제는 VertexList = listS 인 경우 vertex_index를 내 버텍스의 속성으로 사용하지 않는 것 같습니다.
/usr/local/include/boost-1_39/boost/property_map.hpp : 멤버 함수에서 'R 부스트 :: iterator_property_map으로는 :: 연산자 [] (유형 이름이 connected_components이 논문처럼 나에게 오류를 제공합니다 부스트 : property_traits :: key_type)는 RandomAccessIterator = __gnu_cxx와 CONST는 [:: __ normal_iterator , IndexMap = 부스트 : adj_list_vertex_property_map, 부스트 : 상세 :: error_property_not_found, CONST 부스트 : 세부 :: &을 error_property_not_found boost :: vertex_index_t>, T = 부스트 :: default_color_type, R = 부스트 :: default_color_type &] '
그래서하는 질문 : 어떻게 내 정점의 속성으로 vertex_index 추가합니까?
추가 할 경우 add_vertex, remove_vertex 등을 호출 할 때마다 각 정점에 대해이 정보를 업데이트해야한다는 의미입니까?