prg_graph_edge_insert()
Abstract
Creates and inserts an edge between two vertices in the graph
Syntax
prg_graph_edge_insert (graph_ptr, vertex_a_ptr, vertex_b_ptr, edge_type)
| Argument | Type | Description |
|---|---|---|
graph_ptr |
PrgT_Graph * |
The graph where the edge will reside |
vertex_a_ptr |
PrgT_Graph_Vertex * |
Source vertex for the edge |
vertex_b_ptr |
PrgT_Graph_Vertex * |
Destination vertex for the edge |
edge_type |
PrgT_Graph_Edge_Type | Type of edge to create (one of the values in Table 4 Graph Package Symbolic Constants) |
Return Type
PrgT_Graph_Edge *
Returns the created edge, otherwise PRGC_NIL
Header
prg_graph.h
Details
An edge has a type, which specifies if it is simplex (unidirectional) or duplex (bidirectional). The corresponding values for type are the constants PrgC_Graph_Edge_Simplex or PrgC_Graph_Edge_Duplex, respectively. In both cases, the first vertex, "vertex a", is considered the source of the link, and "vertex b" is considered the destination. In the case of a simplex link, this distinction is of significance, while in the case of the duplex link, the source and destinations would typically be interchangeable.