Building Graphs
Clients of the Prg_Graph package (hereinafter referred to simply as “clients”), can maintain many graphs simultaneously. As with most packages provided with the OPNET Development Kit, this is accomplished through the concept of handles, which are simply implemented as pointers in the case of Prg_Graph. The pointers are for objects of the following pre-defined types corresponding to graphs, vertices, and edges, respectively:
PrgT_GraphPrgT_Graph_VertexPrgT_Graph_Edge
Pointers are returned to clients by Prg_Graph functions that create new entities, including graphs, vertices, and edges. These functions are shown below:
By calling prg_graph_create() twice, for example, the client receives two distinct PrgT_Graph * return values. Each of these constitutes a handle for its respective graph. These pointers are saved by the client and passed in as arguments to many of the functions in Prg_Graph to specify the context for the operation or query of interest. The two graphs can evolve independently of each other in terms of adding structure and state information.
Naturally, Prg_Graph provides all the necessary functions to remove edges and vertices from a graph, as well as to destroy edges, vertices, and entire graphs. See the individual function descriptions in Function Descriptions for more information on these capabilities.