CvGraphAddEdge Method (CvGraph, Int32, Int32, CvGraphEdge, IntPtr) OpenCvSharp Class Library
Adds edge to graph

Namespace:  OpenCvSharp
Assembly:  OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax

public static int GraphAddEdge(
	CvGraph graph,
	int startIdx,
	int endIdx,
	CvGraphEdge edge,
	IntPtr insertedEdge
)

Parameters

graph
Type: OpenCvSharpCvGraph
Graph.
startIdx
Type: SystemInt32
Index of the starting vertex of the edge.
endIdx
Type: SystemInt32
Index of the ending vertex of the edge. For unoriented graph the order of the vertex parameters does not matter.
edge
Type: OpenCvSharpCvGraphEdge
Optional input parameter, initialization data for the edge.
insertedEdge
Type: SystemIntPtr
Optional output parameter to contain the address of the inserted edge.

Return Value

Type: Int32
The function cvGraphAddEdge connects two specified vertices. The function returns 1 if the edge has been added successfully, 0 if the edge connecting the two vertices exists already and -1 if either of the vertices was not found, the starting and the ending vertex are the same or there is some other critical situation. In the latter case (i.e. when the result is negative) the function also reports an error by default.
See Also

Reference