import java.util.List;
import java.util.Iterator;
/**
* Represents an abstract simple graph.
* @author astjohn
*
*/
public interface Graph
{
/**
* Add a vertex to the graph.
*/
public void addVertex( GraphVertex v );
/**
* Get a vertex from the graph with the given ID.
* Returns null if no such vertex exists.
*/
public GraphVertex getVertex( int ID );
/**
* Remove a vertex from the graph with the given ID.
*/
public void removeVertex( int ID );
/**
* Get the number of vertices in this graph.
*/
public int numVertices();
/**
* Add an edge to the graph with endpoints given by
* vertices with ID1 and ID2. (Do not add if it already
* exists).
*/
public void addEdge( int ID1, int ID2);
/**
* Remove an edge from the graph with endpoints given by
* vertices with ID1 and ID2.
*/
public void removeEdge( int ID1, int ID2 );
/**
* Check if an edge exists with endpoints given by
* vertices with ID1 and ID2.
*/
public boolean isEdge( int ID1, int ID2 );
/**
* Get the edges in the graph. Each edge is stored
* as a 1-dimensional array of length 2 with the
* endpoints.
*/
public Iterator<GraphVertex[]> getEdges();
/**
* Get the number of edges in this graph.
*/
public int numEdges();
/**
* Return a list of vertices visited by a depth-first traversal
* from the vertex with the given ID.
*
* If the ID is invalid, returns null.
*/
public List<GraphVertex> depthFirst( int ID );
/**
* Return a list of vertices visited by a breadth-first traversal
* from the vertex with the given ID.
*
* If the ID is invalid, returns null.
*/
public List<GraphVertex> breadthFirst( int ID );
}