-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraphDriver.cpp
37 lines (34 loc) · 919 Bytes
/
GraphDriver.cpp
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
36
37
#include <iostream>
#include "Graph.h"
using namespace std;
int main(){
Graph graph ("graph351.txt");
cout<<"MSTweight: "<<graph.modKruskalMST()<<endl;
std::vector<Edge> v = graph.getMST();
// for (int i = 0; i < v.size(); ++i)
// {
// cout<<v[i].src<<" "<<v[i].dest<<endl;
// }
double Z[] = {-1,1,1,1,1,-1,-1,-1,-1};
Graph negPartition, posPartition;
graph.readSegments(&negPartition, &posPartition, Z);
cout<<"neg"<<endl;
cout<<negPartition.getE()<<endl;
negPartition.toAdjMat();
vector <Edge> test;
cout<<"V: "<<negPartition.getV()<<endl;
for (int i = 0; i < negPartition.getV(); ++i)
{
cout<<negPartition.indices[i]<<" ";
}
negPartition.printEdges();
cout<<endl;
negPartition.dijkstra(0,test,true);
// graph.printAdjMat();
cout<<"Test: "<<endl;
for (int i = 0; i < test.size(); ++i)
{
cout<<test[i].src<<" "<<test[i].dest<<" === "<<test[i].weight<<endl;
}
return 0;
}