org.gephi.statistics.plugin

## Class GraphDistance

• All Implemented Interfaces:

```public class GraphDistance
extends Object
Ref: Ulrik Brandes, A Faster Algorithm for Betweenness Centrality, in Journal of Mathematical Sociology 25(2):163-177, (2001)
Author:
pjmcswee, Jonny Wray
• ### Field Summary

Fields
Modifier and Type Field and Description
`static String` `BETWEENNESS`
`static String` `CLOSENESS`
`static String` `ECCENTRICITY`
`static String` `HARMONIC_CLOSENESS`
• ### Constructor Summary

Constructors
Constructor and Description
`GraphDistance()`
Construct a GraphDistance calculator for the current graph model
• ### Method Summary

All Methods
Modifier and Type Method and Description
`Map<String,double[]>` ```calculateDistanceMetrics(org.gephi.graph.api.Graph graph, HashMap<org.gephi.graph.api.Node,Integer> indicies, boolean directed, boolean normalized)```
`boolean` `cancel()`
`HashMap<org.gephi.graph.api.Node,Integer>` `createIndiciesMap(org.gephi.graph.api.Graph graph)`
`void` `execute(org.gephi.graph.api.Graph graph)`
`void` `execute(org.gephi.graph.api.GraphModel graphModel)`
Executes the statistics algorithm.
`double` `getDiameter()`
`double` `getPathLength()`
Gets the average shortest path length in the network
`double` `getRadius()`
`String` `getReport()`
Returns an HTML string that displays the statistics result.
`void` `initializeStartValues()`
`boolean` `isDirected()`
`boolean` `isNormalized()`
`void` `setDirected(boolean isDirected)`
`void` `setNormalized(boolean isNormalized)`
`void` `setProgressTicket(ProgressTicket progressTicket)`
Set the progress ticket for the long task.
• ### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Field Detail

• #### BETWEENNESS

`public static final String BETWEENNESS`
Constant Field Values
• #### CLOSENESS

`public static final String CLOSENESS`
Constant Field Values
• #### HARMONIC_CLOSENESS

`public static final String HARMONIC_CLOSENESS`
Constant Field Values
• #### ECCENTRICITY

`public static final String ECCENTRICITY`
Constant Field Values
• ### Constructor Detail

• #### GraphDistance

`public GraphDistance()`
Construct a GraphDistance calculator for the current graph model
• ### Method Detail

• #### getPathLength

`public double getPathLength()`
Gets the average shortest path length in the network
Returns:
average shortest path length for all nodes
• #### getDiameter

`public double getDiameter()`
Returns:
the diameter of the network

`public double getRadius()`
Returns:
• #### execute

`public void execute(org.gephi.graph.api.GraphModel graphModel)`
Description copied from interface: `Statistics`
Executes the statistics algorithm.

It is preferable to work on visible graphs, to be synchronized with the visualization.

Specified by:
`execute` in interface `Statistics`
Parameters:
`graphModel` -
• #### execute

`public void execute(org.gephi.graph.api.Graph graph)`
• #### calculateDistanceMetrics

```public Map<String,double[]> calculateDistanceMetrics(org.gephi.graph.api.Graph graph,
HashMap<org.gephi.graph.api.Node,Integer> indicies,
boolean directed,
boolean normalized)```
• #### createIndiciesMap

`public HashMap<org.gephi.graph.api.Node,Integer> createIndiciesMap(org.gephi.graph.api.Graph graph)`
• #### initializeStartValues

`public void initializeStartValues()`
• #### setNormalized

`public void setNormalized(boolean isNormalized)`
• #### isNormalized

`public boolean isNormalized()`
• #### setDirected

`public void setDirected(boolean isDirected)`
• #### isDirected

`public boolean isDirected()`
• #### getReport

`public String getReport()`
Description copied from interface: `Statistics`
Returns an HTML string that displays the statistics result. Can contains complex HTML snippets and images.
Specified by:
`getReport` in interface `Statistics`
Returns:
• #### cancel

`public boolean cancel()`
Description copied from interface: `LongTask`
Cancel the task. Returns `true` if the task has been sucessfully cancelled, `false` otherwise.
Specified by:
`cancel` in interface `LongTask`
Returns:
• #### setProgressTicket

`public void setProgressTicket(ProgressTicket progressTicket)`
Description copied from interface: `LongTask`
Set the progress ticket for the long task. Can't be null.
Specified by:
`setProgressTicket` in interface `LongTask`
Parameters:
`progressTicket` -