Macaulay2 » Documentation
Packages » Graphs :: eccentricity
next | previous | forward | backward | up | index | toc

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

- Usage:
    `k = eccentricity (G, v)`
- Inputs:
  - G, a graph, G must be a connected graph
  - v, a thing, v needs to be a vertex of the graph
- Outputs:
  - k, an integer,

## 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

## See also

- distance -- Computes the distance between two vertexSet in a graph
- radius -- Returns the radius of a graph
- isConnected -- determines whether a graph is connected

## Ways to use eccentricity:

- `eccentricity(Graph,Thing)`

## For the programmer

The object eccentricity is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Graphs.m2:3570:0.