-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraph.h
47 lines (45 loc) · 974 Bytes
/
Graph.h
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
38
39
40
41
42
43
44
45
46
47
//
// Node.h
// Project 5
//
// Created by Benjamin Elvon Bay on 7/31/15.
// Copyright (c) 2015 Benjamin Elvon Bay. All rights reserved.
//
#pragma once
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <cctype>
#include <algorithm>
#include <sstream>
#include <set>
#include <map>
#include <stack>
#include "Node.h"
using namespace std;
class Graph {
protected:
map<int, Node> the_graph;
stack<Node> N_stack;
vector<int> SCCorderNodes;
vector<set<int>> SCCs;
set<int> used_nodes;
public:
Graph();
~Graph();
vector<set<int>> getSCCs();
vector<int>* getSCCorderNodes();
stack<Node>* getStack();
stack<Node> getStackCopy();
map<int,Node>* getMap();
map<int,Node>* getPOMap();
void addNode(int, Node);
int size();
vector<Node> getNodes();
bool contain(int);
void addSCCorderNode(int);
void addSCC(set<int>);
void reset();
set<int> getUsedNodes();
};