The program you write for this lab will read in the number of nodes (less than 10) and a binary relation representing a graph. The program will create an adjacency matrix from the binary relation. The program will then print the following menu along with appropriate prompts for the user:(NOTE: the c++ program has to be written by using an Array, you can not use pointer )
1. Print the adjacency matrix
2. Determine if there are any isolated nodes
3. Determine the degree of a node
4. Determine if an Euler path exists
5. Determine if one node is adjacent to another
6. Quit
Notice that number 3 will require you to ask the user for the node in question, and number 5 will require you to ask for the two nodes.
Sample run (program output in boldface):
Please input the number of nodes:
6
Please input the adjacency relation:
{(1,2),(1,5),(2,1),(2,3),(3,2),(3,4),(4,3),(4,5),(5,1),(5,4)}
Choose from the following
1. Print the adjacency matrix
2. Determine if there are any isolated nodes
3. Determine the degree of a node
4. Determine if an Euler path exists
5. Determine if one node is adjacent to another
6. Quit
1
The Adjacency matrix is:
0 1 0 0 1 0
1 0 1 0 0 0
0 1 0 1 0 0
0 0 1 0 1 0
1 0 0 1 0 0
0 0 0 0 0 0
Choose from the following
1. Print the adjacency matrix
2. Determine if there are any isolated nodes
3. Determine the degree of a node
4. Determine if an Euler path exists
5. Determine if one node is adjacent to another
6. Quit
2
6 is an isolated node
Choose from the following
1. Print the adjacency matrix
2. Determine if there are any isolated nodes
3. Determine the degree of a node
4. Determine if an Euler path exists
5. Determine if one node is adjacent to another
6. Quit
3
Which node are you interested in?
2
The degree of node 2 is 2
Choose from the following
1. Print the adjacency matrix
2. Determine if there are any isolated nodes
3. Determine the degree of a node
4. Determine if an Euler path exists
5. Determine if one node is adjacent to another
6. Quit
4
An Euler path does exist in the graph.
Choose from the following
1. Print the adjacency matrix
2. Determine if there are any isolated nodes
3. Determine the degree of a node
4. Determine if an Euler path exists
5. Determine if one node is adjacent to another
6. Quit
5
Which two nodes are you interested in?
2
4
Node 2 is NOT adjacent to node 4
Choose from the following
1. Print the adjacency matrix
2. Determine if there are any isolated nodes
3. Determine the degree of a node
4. Determine if an Euler path exists
5. Determine if one node is adjacent to another
6. Quit
6
Goodbye