Advertisement
Guest User

Untitled

a guest
May 28th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.88 KB | None | 0 0
  1. #include <iostream>
  2. #include "graphsearch.hh"
  3. #include "stoper.hh"
  4. #include <cstdlib>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.  
  11.   int x=1000;
  12.   Stoper pomiar;
  13.   graphSearch *graf=new graphSearch;
  14.  
  15.   cout<<"Ustawianie wierzcholkow"<<endl;
  16.   for(int i=0;i<x;i++)
  17.     graf->addVertex(i);
  18.  
  19.   cout<<"Ustawianie krawedzi"<<endl;
  20.   for(int i=0;i<x;i++)
  21.     graf->addEdge(i,i+1);
  22.   graf->addEdge(0,x-1);
  23.   cout<<"Dodawanie losowych krawedzi"<<endl;
  24.   for(int i=0;i<(x/10);i++)
  25.     graf->addEdge(rand()%x,rand()%x);
  26.  
  27.   pomiar.Start();
  28.     graf->BBsearch(rand()%x);
  29.   //graf->findPathBFS(0,rand()%X);
  30.   pomiar.Stop();
  31.   cout<<"BranchAndBound czas :"<< pomiar.getElapsedTime() <<endl;
  32.  
  33.   pomiar.Start();
  34.     graf->BBsearch_with_extended_list(rand()%x);
  35.   //graf->findPathBFS(0,rand()%X);
  36.   pomiar.Stop();
  37.   cout<<"BranchAndBound czas :"<< pomiar.getElapsedTime() <<endl;
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement