Skip to content
Unick Soft edited this page Dec 26, 2020 · 7 revisions

Description of IGraph interface methods:

  • GetNodesCount() - return number of nodes in graph

  • GetEdgesCount() - return number of edges in graph.

  • GetNode(IndexType index) - return NodeId by index. Indexes are from 0 to GetNodesCount() - 1

  • GetNode(const char* nodeId) - return NodeIf by text id.

  • GetEdge(ObjectId source, ObjectId target) - return EdgeId by connected nodes. Use NodeId for nodes.

  • GetConnectedNodes(ObjectId source) - number of nodes, which is connected this source. "Connected" mean you can go from source to another,

  • GetConnectedNode(ObjectId source, IndexType index) - return NodeId for node, connected with source by index. Indexes are from 0 to GetConnectedNodes(source) - 1

  • AreNodesConnected(ObjectId source, ObjectId target) - return true if you can go from source to target.

  • GetNodeStrId(ObjectId node, char* outBuffer, IndexType bufferSize) - copy node text id to outBuffer and return true if copy is success.

  • GetEdgeStrId(ObjectId edge, char* outBuffer, IndexType bufferSize) - copy edge text id to outBuffer and return true if copy is success.

  • IsEgdeExists(ObjectId source, ObjectId target, bool onlyInSourceGraph = true) - return true if edge from source target. If onlyInSourceGraph is true, it will check only edge from source to target for undirect edges (don't check edge from target to source).

  • GetEdgeWeightType() - return type of edge weight EdgeWeightType. Use this method to know right cast weight interface IGraphInt, IGraphFloat, IMultiGraphInt, IMultiGraphFloat.

  • MakeBaseCopy(GraphCopyType type) - made graph copy by type GraphCopyType.

  • HasDirected() - return true if graph has directed egdes. Graph can has directed and undirected edges.

  • HasUndirected() - return true if graph has undirected egdes. Graph can has directed and undirected edges.

  • IsMultiGraph() - return true if graph is multigraph.

  • ProcessDFS(IEnumStrategy* pEnumStrategy, ObjectId startedNode) - enumerate nodes/edges use Depth-first search. Read more about IEnumStrategy.

  • RemoveEdge(ObjectId source, ObjectId target) - return egdes from source to target. For undirected edge it removes source to target edge or target to source edge.

  • GetSourceNodesNumber(ObjectId target) - return number of nodes which are source for target node.

  • AddEdge(ObjectId source, ObjectId target, bool direct, const FloatWeightType& weight) - add edge from source to target with params direct/undirect and weight.

  • AddNode(bool fake) - add new Node. Node can be marked as fake for temporary nodes.

  • IsFakeNode(ObjectId source) - return true if node is fake.

  • PrintGraph() - print graph as text.

Clone this wiki locally