-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAnalyzer.cpp~
More file actions
35 lines (32 loc) · 891 Bytes
/
Analyzer.cpp~
File metadata and controls
35 lines (32 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "gml.h"
#include "network.h"
#include <random>
grph g;
typedef map<string,ssnode> :: iterator it;
void query(int q, char* e1, char* e2){
int variable = rand()%g.student.size();
vector<string> answer;
switch(q){
case 1:
cout << sizeofclique(e1,g,&g.student.at(e1).friends).size() << endl;
break;
case 2: cout << lengthsp(e1,e2,g) << endl;
break;
case 3: answer = listsp(e1,e2,g);
for(int k=0 ;k<answer.size() ; k++){
cout << answer.at(k) << "to " << endl;
}
break;
//case 4: cout << g.student[variable]->entrynumber << " " << g.student.at(variable)->info->friends.at(0) << endl;
// break;
case 5: cout << floydwarshall(e1,&g) << endl;
break;
case 6: cout << moreimp(e1,&g) <<endl;
break;
}
}
int main(int argc,char** argv){
g=readGraph("Graph.graphml");
cout<<argv[3]<<endl;
query(atoi(argv[1]),argv[2],argv[3]);
}