
374 Data Structures Using C
(2) Deletion: Similarly, a node or an edge or both can be deleted from an existing graph.
(3) Traversal: A graph may be traversed for many purposes—to search a path, to search a goal, to
establish a shortest path between two given nodes, etc.
8.4.1 Insertion Operation
The insertion of a vertex and its associated edge with other vertices in an adjacency matrix involves
the following operations:
(1) Add a row for the new vertex.
(2) Add a column for the new vertex.
(3) Make appropriate entries into the rows and columns of the adjacency matrix for the new edges.
Consider the graph given in Figure 8.16.
Fig. 8.16 Insertion ...