// Graph abstract class. This ADT assumes that the number // of vertices is fixed when the graph is created. class Graph { public: // Return the number of vertices in the graph virtual int n() =0; // Return the current number of edges in the graph virtual int e() =0; // Store an edge from v1 to v2 with weight wgt virtual void setEdge(int v1, int v2, int wgt) =0; // Delete the edge going from v1 to v2 virtual void delEdge(int v1, int v2) =0; // Return weight of the edge from v1 to v2. // Return 0 if no such edge exists. virtual int weight(int v1, int v2) =0; // Get the mark value for vertex v virtual int getMark(int v) =0; // Set the mark value for vertex v to be val virtual void setMark(int v, int val) =0; // Return the index of the first neighbor for vertex v virtual int first(int v) =0; // Return the index of the next neighbor // (after v2) for vertex v1 virtual int next(int v1, int v2) =0; };