public class GraphTheoryMetrics extends Object
Class to deal with graph-theory metrics computation.
Important: Internal computations (like shortest-paths) are cached in order to improve efficiency.
Constructor and Description |
---|
GraphTheoryMetrics(List<Node> nodes,
List<Link> links,
SortedMap<Link,Double> linkCostMap)
Default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
configureLinkCostMap(Map<Link,Double> linkCostMap)
Re-configures link cost setting.
|
double |
getAlgebraicConnectivity()
Returns the algebraic connectivity of the network.
|
double |
getAssortativity()
Returns the assortativity of the network.
|
double |
getAverageNeighborConnectivity()
Returns the average neighbor connectivity.
|
double |
getAverageOutNodeDegree()
Returns the average number of outgoing links per node.
|
double |
getAverageShortestPathDistance()
Returns the average shortest path distance among all node-pair shortest paths.
|
double |
getAverageTwoTermReliability()
Returns the average two-term reliability (A2TR) of the network.
|
double |
getClusteringCoefficient()
Returns the clustering coefficient of the network.
|
double |
getDensity()
Returns the density of the network.
|
double |
getDiameter()
Returns the diameter of the network.
|
double |
getHeterogeneity()
Returns the heterogeneity of the network.
|
DoubleMatrix1D |
getLinkBetweenessCentrality()
Returns the betweeness centrality of each link.
|
int |
getLinkConnectivity()
Returns the link connectivity.
|
Collection<Node> |
getNeighbors(Node node)
Returns the set of nodes reachable from a given node.
|
DoubleMatrix1D |
getNodeBetweenessCentrality()
Returns the betweeness centrality of each node.
|
int |
getNodeConnectivity()
Returns the node connectivity.
|
DoubleMatrix1D |
getOutNodeDegree()
Returns the number of outgoing links for each node.
|
double |
getSpectralRadius()
Returns the spectral radius of the network.
|
double |
getSymmetryRatio()
Returns the symmetry ratio.
|
public GraphTheoryMetrics(List<Node> nodes, List<Link> links, SortedMap<Link,Double> linkCostMap)
nodes
- List of odeslinks
- List of linkslinkCostMap
- Cost per link, where the key is the link identifier and the value is the cost of traversing the link. No special iteration-order (i.e. ascending) is requiredpublic void configureLinkCostMap(Map<Link,Double> linkCostMap)
linkCostMap
- Cost per link, where the key is the link identifier and the value is the cost of traversing the link. No special iteration-order (i.e. ascending) is requiredpublic double getAlgebraicConnectivity()
Returns the algebraic connectivity of the network. The algebraic connectivity is equal to the second smallest eigenvalue of the laplacian matrix.
For symmetric (or undirected) networks, if the algebraic connectivity is different from zero, it is ensured that the network is connected, that is, it is possible to find a path between each node pair.
public double getAssortativity()
public double getAverageNeighborConnectivity()
public double getAverageOutNodeDegree()
public double getAverageShortestPathDistance()
public double getAverageTwoTermReliability()
public double getClusteringCoefficient()
public double getDensity()
public double getDiameter()
public double getHeterogeneity()
public DoubleMatrix1D getLinkBetweenessCentrality()
Returns the betweeness centrality of each link. The betweeness centrality of a link is equal to the number of node-pair shortest paths which traverses the link.
Internally it makes use of the Brandes' algorithm.
public int getLinkConnectivity()
Returns the link connectivity. The link connectivity is equal to the smallest number of link-disjoint paths between each node pair.
Internally it makes use of the Edmonds-Karp algorithm to compute the maximum flow between each node pair, assuming a link capacity equal to one for every link.
public Collection<Node> getNeighbors(Node node)
node
- Nodepublic DoubleMatrix1D getNodeBetweenessCentrality()
Returns the betweeness centrality of each node. The betweeness centrality of a node is equal to the number of node-pair shortest paths which traverses the node.
Internally it makes use of the Brandes' algorithm.
public int getNodeConnectivity()
Internally it makes use of the (modified) Edmonds-Karp algorithm to compute the maximum flow between each node pair, assuming a link capacity equal to one for every link.
public DoubleMatrix1D getOutNodeDegree()
public double getSpectralRadius()
public double getSymmetryRatio()
Copyright © 2018. All rights reserved.