#ifndef GRAPH_H
#define GRAPH_H

#include <vector>


// Class is parameterized by the types of structure used to hold
// information associated with vertices and edges.
// Vertices are referenced by an integer index between 0 and n-1;
// edges are referenced by a pair of vertex indices.
// The graph is undirected so (i, j) and (j, i) are the same edge.

template <class Vertex, class Edge>
class graph
{
public:

  graph(int sz = 0);		// Argument is number of vertices in graph.

  int vsize();			// Return number of vertices.

  Vertex & vertex(int v);	// Return the data associated with vertex v.

  bool exists(int u, int v);	// Return true if the edge exists.

  Edge & edge(int u, int v);	// Return the data assoc. with edge (u, v).
				// Note that (v, u) should return the same.
				// This fails if edge does not exist.

  void add_edge(Edge & e, int u, int v); // Add new edge (u, v) to graph.
};


#endif
