incubator-graphar
incubator-graphar copied to clipboard
[Feat][C++] Improve high-level APIs of the C++ library to provide the view and operations at the graph level
Is your feature request related to a problem? Please describe.
Currently, the C++ library of GraphAr provides some high-level structures and related methods, i.e., VerticesCollection and EdgesCollection. However, a view of the whole graph and the operations are required for conduct processing more conveniently.
Describe the solution you'd like Proposal TBF
May be we can provide a Graph class, which can traverse all vertices and edges, instead of a specific type.
class Graph {
explicit Graph(const GraphInfo& graph_info);
Result<VertexIter> GetAllVerticesBegin();
Result<VertexIter> GetAllVerticesEnd();
bool GetNextVertexIter(VertexIter& iter);
size_t GetVerticesNum();
Result<EdgeIter> GetAllEdgesBegin();
Result<EdgeIter> GetAllEdgesEnd();
bool GetNextEdgeIter(EdgeIter& iter);
size_t GetEdgesNum();
}
Result<Graph> ConstructGraph(const GraphInfo& graph_info);
TODO:
- support to look for a vertex? edges of a single vertex?
- provide graph-level reading/writing/transforming methods?