java.lang.Object | |
↳ | com.pnfsoftware.jeb.util.graph.Digraph |
A directed graph object, cyclic or acyclic. Self-loops (x>x) are also allowed. Duplicate edges are not allowed, e.g. if an edge x>y exists, another edge x>y cannot be added (a way to represent this information is to specify an edge weight).
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
class | Digraph.E | Oriented edge with optional weight. | |||||||||
class | Digraph.V | Vertex of a directed graph. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Digraph() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean | canReach(Digraph.V from, Digraph.V to) | ||||||||||
List<Integer> |
computeEdgeBetweenness()
Compute the edge-betweenness score of all edges of the graph using Girvan-Newman.
| ||||||||||
List<Digraph.E> | copyOfEdges() | ||||||||||
List<Digraph.V> | copyOfVertices() | ||||||||||
static Digraph | create() | ||||||||||
Digraph |
done()
Clients can call this method to indicate that the initial graph is built: after calling this
method, additions of vertices or edges is forbidden.
| ||||||||||
Digraph | e(int srcId, int dstId, Double weight) | ||||||||||
Digraph | e(int srcId, int dstId) | ||||||||||
Digraph.E | getEdge(int srcId, int dstId) | ||||||||||
Digraph.E | getEdge(int index) | ||||||||||
int | getEdgeCount() | ||||||||||
List<Integer> | getEdgeIndexesByDescendingBetweenness() | ||||||||||
List<Digraph.E> | getEdges() | ||||||||||
Set<Integer> | getReachableVertices(int fromId) | ||||||||||
Digraph.V | getVertex(int id) | ||||||||||
Digraph.V | getVertexByIndex(int index) | ||||||||||
int | getVertexCount() | ||||||||||
List<Integer> | getVertexIndexesByDescendingCentrality() | ||||||||||
String | getVertexLabel(int id) | ||||||||||
List<Digraph.V> | getVertices() | ||||||||||
List<Digraph> | getWeaklyConnectedComponents() | ||||||||||
boolean | isAdjacent(Digraph.V from, Digraph.V to) | ||||||||||
boolean |
isWeaklyConnected()
Determine if this directed graph is weakly connected, that is, if the similar undirected
graph is connected.
| ||||||||||
static Digraph |
load(File file)
@return
| ||||||||||
void | removeEdge(Digraph.E e) | ||||||||||
void | removeEdge(int index) | ||||||||||
void | removeVertex(Digraph.V v, boolean reconnectEdges) | ||||||||||
void | resetEdgeBetweennessScores() | ||||||||||
void | setVertexLabel(int id, String label) | ||||||||||
void | setVertexLabels(Object... idLabels) | ||||||||||
String | toString() | ||||||||||
Digraph | v(int id) | ||||||||||
Digraph |
v(int id, Double weight, String label)
Add a vertex to this graph.
| ||||||||||
Digraph | v(int id, Double weight) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Compute the edge-betweenness score of all edges of the graph using Girvan-Newman. The scores are placed in E#ebscore.
Clients can call this method to indicate that the initial graph is built: after calling this method, additions of vertices or edges is forbidden. However, removal of edges is allowed.
Determine if this directed graph is weakly connected, that is, if the similar undirected graph is connected.
Add a vertex to this graph.
weight | optional |
---|---|
label | optional |