# Primitive functions on graph represented by adjacency matrix

Modify the program that implements a 6x6 adjacency matrix for a graph. Remember that an adjacency matrix is a two-dimensional array.

The program should implement the necessary primitive functions on graphs:

updateNode(), insertNode(), insertEdge(), deleteNode(), deleteEdge(), retrieve(), and adjacent().

The program should also include a printGraph() method that prints the adjacency matrix.

The output of the program should appear as follows:

Adjacency Matrix:

0 1 2 3 4 5

0 0 1 1 1 0 0

1 0 0 0 0 1 0

2 0 1 0 0 1 0

3 0 0 0 0 0 0

4 0 0 0 0 0 0

5 0 1 0 1 0 0

The data are:

0: 0

1: 1

2: 2

3: 3

4: 4

5: 5

0 is connected to 1

3 is not connected to 2

** Press any key to continue **

https://brainmass.com/computer-science/arrays/primitive-functions-graph-represented-adjacency-matrix-327090

#### Solution Summary

Code has been inserted (but commented) to deal with undirected graphs as well.