incubator-graphar icon indicating copy to clipboard operation
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

Open lixueclaire opened this issue 2 years ago • 1 comments

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

lixueclaire avatar May 06 '23 06:05 lixueclaire

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?

lixueclaire avatar May 09 '23 11:05 lixueclaire