Question: Problem 1. (Graph Properties) The eccentricity of a vertex v is the length of the shortest path from that vertex to the furthest vertex from
Problem 1. (Graph Properties) The eccentricity of a vertex v is the length of the shortest path from that vertex to the furthest vertex from v. The diameter of a graph is the maximum eccentricity of any vertex. The radius of a graph is the smallest eccentricity of any vertex. A center is a vertex whose eccentricity is the radius. Implement a data type GraphProperties that supports the following API to calculate the aforementioned graph properties: (Hint: use BreadthFirstPaths)

And the result should look like this:

Here's the input file:
13 15 0 5 4 3 0 1 9 12 6 4 5 4 0 2 11 12 9 10 0 6 7 8 9 11 5 3 6 10 3 7
And here's the format should look like:


The only thing to do is just to change the " . . . " to real code. Thanks.
method GraphProperties (Graph G) int eccentricity(int v) int diameter() int radius() Iterable
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
