You can get answers to this question. Good library of Java graph algorithms?
Multiple Java Graph Libraries: JGraph Graph Visualization Library
Java Graph Algorithm Library JGraphT
If you are not working, you probably want to organize the diagrams using the structure as shown below and run the algorithm on it.
public class Node<T> { public T NodeData; public List<Edge> edges; } public class Edge { public Node<S> Source; public Node<D> Destination; public int weight; }
source share