Package dev.nm.graph.community
Class EdgeBetweeness<V>
- java.lang.Object
-
- dev.nm.graph.community.EdgeBetweeness<V>
-
- Type Parameters:
V
- vertex type
public class EdgeBetweeness<V> extends Object
The edge betweenness centrality is defined as the number of the shortest paths that go through an edge in a graph or network.- See Also:
- Edge Betweenness Centrality
-
-
Constructor Summary
Constructors Constructor Description EdgeBetweeness(UnDiGraph<V,? extends UndirectedEdge<V>> g)
Computes the edge-betweeness-es of all edges in an undirected graph.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(UndirectedEdge<V> edge)
Checks if the graph contains an edge.Set<UndirectedEdge<V>>
edges()
Gets the set of all edges in the graph.boolean
isEmpty()
Checks if there is no edge, e.g., all vertices are isolated.UndirectedEdge<V>
maxEdge()
Gets the edge with the maximal edge-betweeness.double
maxValue()
Gets the maximum of edge-betweeness-es.String
toString()
double
value(UndirectedEdge<V> edge)
Gets the edge-betweeness of an edge.
-
-
-
Constructor Detail
-
EdgeBetweeness
public EdgeBetweeness(UnDiGraph<V,? extends UndirectedEdge<V>> g)
Computes the edge-betweeness-es of all edges in an undirected graph.- Parameters:
g
- an undirected graph
-
-
Method Detail
-
contains
public boolean contains(UndirectedEdge<V> edge)
Checks if the graph contains an edge.- Parameters:
edge
- an edge- Returns:
true
if the graph contains an edge
-
value
public double value(UndirectedEdge<V> edge)
Gets the edge-betweeness of an edge.- Parameters:
edge
- an edge- Returns:
- the edge-betweeness
-
edges
public Set<UndirectedEdge<V>> edges()
Gets the set of all edges in the graph.- Returns:
- the set of all edges
-
maxEdge
public UndirectedEdge<V> maxEdge()
Gets the edge with the maximal edge-betweeness.- Returns:
- the edge with the maximal edge-betweeness;
null
if no edge in the cluster
-
maxValue
public double maxValue()
Gets the maximum of edge-betweeness-es.- Returns:
- the maximal edge-betweeness-es
-
isEmpty
public boolean isEmpty()
Checks if there is no edge, e.g., all vertices are isolated.- Returns:
true
if there is no edge
-
-