#include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <string>
#include <utility>
#include <vector>
#include <limits>
#include <list>

#include "graph.h"


void
main(int argc, char * argv[])
{
  int n;
  std::cout << "Enter number of vertices: " << std::flush;
  std::cin >> n;
  graph<int, int> g(n);

  for (int i=0; i < g.vsize(); ++i)
    g.vertex(i) = i;
  
  std::cout << "Type Ctrl-C when done..." << std::endl;
  std::cout << std::endl;
  int e = 0;
  for (;;)
  {
    std::cout << std::endl
	      << "Enter an edge (two integers from 0 to " << n-1 << "): " 
	      << std::flush;
    int u, v;
    std::cin >> u;
    std::cin >> v;

    if (u < n && v < n)
      g.add_edge(++e, u, v);

    std::cout << "The graph now has the following edges:" << std::endl;
    for (int i=0; i < n; ++i)
      for (int j=i+1; j < n; ++j)
	if (g.exists(i, j))
	  std::cout << "(" << i << ", " << j << ") with weight "
		    << g.edge(i, j) << std::endl;
  }
}

