Question: ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
USE MATLAB Graph Stats Note: This question is used for course assessment. As such, you are
highly encouraged to follow the instructions carefully and fully comment your code.
During assessment, identifying student data is removed, so this process is anonymized.
As discussed earlier this semester, connections in a simple undirected graph can be
represented through an adjacency matrix. Often, we wish to allow graphs to have
directed oneway edges instead of undirected twoway ones. In this context, we
place a in location aij if there is an edge from node i to node j Given a node,
we then define its indegree as the number of edges terminating at the node and the
outdegree as the number of edges leaving the node. We also often allow edges to
start from and terminate at the same node; these edges are called loops and will be
represented in the adjacency matrix by a in a diagonal entry For example, the
following adjacency matrix represents the connections in the depicted graph
In this problem, you will write a function that takes in the adjacency matrix of a
simple directed graph and will compute the total number of edges, the in and out
degrees of all nodes, and a list of all nodes which have loops. Be sure to use for loops
and running computations to determine these quantities.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
