// file: Graph.h
// pg 17, Algorithms in C++, Part 5, Robert Sedgewick

// Graph ADT interface
#ifndef GRAPH_H
#define GRAPH_H

struct Edge {
  int v, w;
  Edge(int v = -1, int w = -1) : v(v), w(w) {} // Uses the initializers
};

class Graph {
private:
  // Implementation-dependent code
public:
  Graph(int numVerts, bool directed);
  ~Graph();
  int V() const;  // Returns number of vertices
  int E() const;  // Returns number of edges
  bool directed() const;
  int insert(Edge);
  int remove(Edge);
  bool edge(int, int);

  // Removes parallel and self edges
  void makeSimpleGraph();

  class AdjIterator {
  public:
    AdjIterator(const Graph &, int);
    int beg();
    int nxt();
    bool end();
  };
};

#endif
