Graph data structure

by javadream on 09 Apr 11
0
 
465 downloads
0

Graph is a data structure used in many algorithms. It's vertices are represented by a separate class, Vertex. There is a data (Object type) field in vertex class, which can be used to store any data. Vertex class can be modified to hold any information (e.g. Student, Account, etc.) by using the example.

Graph uses an array of Vertex objects to store vertices. Vertices are numbered from 0 to (n-1), where n is the size of graph. Also, the graph keeps the edges in a adjacency matrix. This graph implementation in java is a very general purpose. You need to add/edit required functionality in different algorithms.

Bookmark and Share

Relevant links

Related algorithms

You must login or register to post comments