-1

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

Sabhareesh_R
  • 1
  • 1
  • 2
  • Some examples are cited [here](http://stackoverflow.com/a/10047021/230513). – trashgod Jun 04 '13 at 08:33
  • 1
    hope this previous post on graph representation help http://stackoverflow.com/questions/1737627/java-how-to-represent-graphs – AurA Jun 04 '13 at 08:33

1 Answers1

1
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

Marcin Szymczak
  • 11,199
  • 5
  • 55
  • 63