//******************************************************************************
//
// Program:     Homework 7 -- Data Structures R Us Shipping Company
//
// Author:      Travis Dillon
// Email:       tdillon@ace.cs.ohiou.edu
//
// Description: This program find the cheapest shipping route between any
//              two cities
//
// Date:        October 29, 2003
//
//******************************************************************************


#include "prog5.h"

int main()
{
   ifstream fin1;
   ifstream fin2;
   string filename;
   
   getline(cin, filename);
   fin1.open(filename.c_str());
   if(fin1.fail())
   {
      cout << "\nBad Input File\n";
      exit(EXIT_FAILURE);
   }
   
   getline(cin, filename);
   fin2.open(filename.c_str());
   if(fin2.fail())
   {
      cout << "\nBad Input File\n";
      exit(EXIT_FAILURE);
   }
   
   Graph ralph;

   cout << "SHIPPING REPORT\n\n";
   ralph.read_num_vertices(fin1, cout);  //O(1)
   ralph.read_vertices_name(fin1, cout);  //O(n*n)
   ralph.read_edges(fin1, cout);  //O(n*n)
   ralph.read_route(fin2, cout);  //O(n)
   ralph.shortest_path(cout);  //O(n*n*n*e)
   ralph.show_path(cout);  //O(n)

   fin1.close();
   fin2.close();

   return EXIT_SUCCESS;
}