public class

Digraph

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.graph.Digraph

Class Overview

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).

Summary

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

Public Constructors

public Digraph ()

Public Methods

public boolean canReach (Digraph.V from, Digraph.V to)

public List<Integer> computeEdgeBetweenness ()

Compute the edge-betweenness score of all edges of the graph using Girvan-Newman. The scores are placed in E#ebscore.

Returns
  • a list of edge indexes ordered by descending order of edge-betweenness score; e.g., if the first element of the list is 2, it means that the third registered edge (getEdge(2)) is the one with the highest EB score

public List<Digraph.E> copyOfEdges ()

public List<Digraph.V> copyOfVertices ()

public static Digraph create ()

public 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. However, removal of edges is allowed.

public Digraph e (int srcId, int dstId, Double weight)

public Digraph e (int srcId, int dstId)

public Digraph.E getEdge (int srcId, int dstId)

public Digraph.E getEdge (int index)

public int getEdgeCount ()

public List<Integer> getEdgeIndexesByDescendingBetweenness ()

public List<Digraph.E> getEdges ()

public Set<Integer> getReachableVertices (int fromId)

public Digraph.V getVertex (int id)

public Digraph.V getVertexByIndex (int index)

public int getVertexCount ()

public List<Integer> getVertexIndexesByDescendingCentrality ()

public String getVertexLabel (int id)

public List<Digraph.V> getVertices ()

public List<Digraph> getWeaklyConnectedComponents ()

public boolean isAdjacent (Digraph.V from, Digraph.V to)

public boolean isWeaklyConnected ()

Determine if this directed graph is weakly connected, that is, if the similar undirected graph is connected.

public static Digraph load (File file)

@return

Throws
IOException

public void removeEdge (Digraph.E e)

public void removeEdge (int index)

public void removeVertex (Digraph.V v, boolean reconnectEdges)

public void resetEdgeBetweennessScores ()

public void setVertexLabel (int id, String label)

public void setVertexLabels (Object... idLabels)

public String toString ()

public Digraph v (int id)

public Digraph v (int id, Double weight, String label)

Add a vertex to this graph.

Parameters
weight optional
label optional

public Digraph v (int id, Double weight)