-
Notifications
You must be signed in to change notification settings - Fork 1
/
graph.cpp
37 lines (31 loc) · 820 Bytes
/
graph.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
//
// graph.cpp
//
//
// Created by arvind sudarsanam on 12/20/14.
//
//
#include "graph.h"
int main()
{
graph<int> *g1 = graph<int>::createGraph5(false);
//if (g1->getNode(0) != NULL)
// g1->dfs(g1->getNode(0));
//if ((g1->getNode(0) != NULL) && (g1->getNode(9) != NULL))
// g1->findPath(g1->getNode(0),g1->getNode(9));
//stack<node <int> *> *st = new stack<node <int> *>();
//g1->topologicalSort(st);
//int cost = g1->findMST();
//cout << "min cost of mst is " << cost << "\n";
//graph<int> *g2 = g1->cloneGraph();
//g1->printMST();
//g2->printMST();
if (g1->getNode(0) != NULL)
g1->findDAGShortestPaths(g1->getNode(0));
if (g1->getNode(0) != NULL)
g1->djikstra(g1->getNode(0));
if (g1->getNode(0) != NULL)
g1->bellmanford(g1->getNode(0));
delete g1;
return 0;
}