# eccentricity -- Returns the eccentricity of a vertex of a graph

## Synopsis

• Usage:
k = eccentricity (G, v)
• Inputs:
• G, an instance of the type Graph, G must be a connected graph
• v, , v needs to be a vertex of the graph
• Outputs:

## Description

The eccentricity of a vertex is the maximal distance between the given vertex and any other vertex in the graph. It gives a measure of how far away a vertex is from the rest of the graph.

 i1 : eccentricity(pathGraph 5, 2) o1 = 2 i2 : eccentricity(pathGraph 5, 1) o2 = 3 i3 : eccentricity(pathGraph 5, 0) o3 = 4