Skip to content
Home arrow Projects arrow University arrow Directed graph
Directed graph
Friday, 27 May 2005

Directed GraphA directed graph is composed of a set of vertices (or nodes) and a set of ordered pairs of vertices, called directed edges, arcs, or arrows.

This assignment was developed with Java 5.0. It consisted in defining and implementing:

  • The class Arco<T> (arc).
  • The interface Vertices<T>, which inherits from Iterable<T>. It has the operations insert, delete, size and isElement.
  • The interface Grafo<T> (graph), which inherits from Vertices<T> and have the operations insertArc, deleteArc, size, isElement, adjacents, previous and following.
  • The class GrafoLAdj<T> which uses a List<List> to store the graph.
  • The interface GrafoAciclico<T> (acyclic graph) which extends Grafo<T> with the operations navigable, path and minimumPath (implemented recursively).
  • The class GrafoAciclicoLAdj<T>, which implements GrafoAciclico<T>, inherits from GrafoLAdj<T> and redefine the operation insertArc to make it acyclic.

Here's the UML diagram that shows the relationships that exist among the classes and interfaces in this system:

UML

 

Source code and documentation (in Spanish) licensed under GNU General Public License (GPL)

The zip file comes with a DriverGrafos.java that can be used to test the project.

 
< Prev