나는 BOOST 라이브러리를 사용하여 간단한 GraphML 로더를 작성하려고합니다. 나는 GraphML 파일을 가지고 있고 그것을 boost adjacency list 구조체에 적재하고 싶다. 그래프는 지시되며 저장되는 유일한 정보는 노드의 이름 (0,1,2, ...)과 한 노드에서 다른 노드로의 에지입니다. 내가 한 일은 :부스트 read_graphml 예
void loadHierarchy(){
// ...
std::ifstream inFile;
inFile.open("ext.gml", std::ifstream::in);
typedef boost::adjacency_list<> Graph;
Graph g;
boost::read_graphml(inFile, g);
// ...
}
인접성 목록에 전체 그래프 정보를 유지하기 위해 속성을 사용할 필요가 없습니다. 내가 할
오류는 다음과 같습니다 :
가error: invalid initialization of reference of type
‘boost::mutate_graph&’
from expression of type‘loadHierarchy()::Graph’
/usr/include/boost/graph/graphml.hpp:194: error: in passing argument 2 of
‘void boost::read_graphml(std::istream&, boost::mutate_graph&)’
그것은 그렇게 간단해야하지만, 분명히 아니다.
확실히 도움이되었습니다. 감사합니다. – EddieBytes