Directed Graph Implementation

Directed Graph Implementation

Source Code:
Github: Digraph.java


Output:

Number of vertices: 4
Number of edges: 6
In-degree of V(1): 2
Out-degree of V(1): 2


Graph: 
{V(0),  [Edge (source=0, destination=1, weight=1.0)]
V(1),  [Edge (source=1, destination=2, weight=2.0), Edge (source=1, destination=3, weight=1.0)]
V(2),  [Edge (source=2, destination=3, weight=1.0), Edge (source=2, destination=1, weight=5.0)]
V(3),  [Edge (source=3, destination=0, weight=2.0)]}

Author: Hrishikesh Mishra