I'm trying to implement a Graph with implements a Collection. Like,
Graph is a Set of Vertices, Set of Edges
But couldn't get the exact implementation
Somebody outline the idea..
I'm trying to implement a Graph with implements a Collection. Like,
Graph is a Set of Vertices, Set of Edges
But couldn't get the exact implementation
Somebody outline the idea..
public class Graph {
private Set<Vertex> nodes;
private Set<Edge> edges;
}
If you want to look at more "serious" implementation of graph check jung library.
You can find basic tutorial here