Graph implementations
Let us create an ADT (Graph_ADT
) for the implementation of functions on a given graph. The key features of ADT for a given graph analysis are the following:
- Fixed number of vertices
- Provision for addition and deletion of edges
- Provision to support a
mark
array, which can assist algorithms in traversing along the graph
The vertices are denoted using non-zero integer values, and can additionally store vertex names or some kind of application-based predetermined values.
The following are some ADT functions that are widely used for implementing graph functions:
num_vert
: This function returns the number of vertices for a given graph.num_edge
: This function returns the number of edges for a given graph.weightEdge
: This function returns ...
Get R Data Structures and Algorithms now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.