Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please don't forget to put the user input user interface: 2[25 Points] Adjacency Matrix Given the Adjacency Matrix of a directed graph, write a C++
please don't forget to put the user input
user interface:
2[25 Points] Adjacency Matrix Given the Adjacency Matrix of a directed graph, write a C++ program to determine the following. a) The vertices with the maximum and minimum in-degree b) The vertices with the maximum and minimum out-degree c) The vertices which are mutually adjacent (two vertices A and B are mutually adjacent if there are edges from A to B and from B to A). Print suitable messages. The program should be designed in a way which facilitates testing by a user via specifying the number of (vertices) nodes, and the vertices adjacent to any given vertex. The following is a suggested outline. You have the flexibility to improve upon it, as long as it provides the interaction by a user to create the graph and ask questions. In the following it is assumed that the vertices are automatically labeled A, B, C, etc. B For example, the interaction when the program is run is as follows (user input is shown in 'red'). Type in the number of vertices in the graph: 5 Type in the vertices adjacent to 'A': BCE Type in the vertices adjacent to B: A, E, D Type in the vertices adjacent to 'C': AC (... etc....) After the graph (ex. above) is created, it should print out the answers to the questions in the exercise. Vertices with self-loops: C Graph is not completely connected The graph has no isolated vertex For the (ex. below), it should print out: B Vertices with the maximum in-degree: E (in-degree = 3) Vertices with the minimum in-degree: D (in-degree = 0) Vertices with the maximum out-degree: A (out-degree = 3) Vertices with the minimum out-degree: E (out-degree = 0) ... EtcStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started