-
Notifications
You must be signed in to change notification settings - Fork 1
/
graph.h
97 lines (74 loc) · 1.7 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#ifndef ___GRAPH_H___
#define ___GRAPH_H___
#include <string>
#include <vector>
class Vertex;
#include "config.h"
class Neighbor {
private:
Vertex** start;
Vertex** stop;
public:
void init(Vertex**);
Vertex** begin();
Vertex** end();
void add(Vertex*);
};
class Vertex {
private:
std::string id;
Neighbor pre;
Neighbor suc;
Vertex* next;
Vertex* other;
long unsigned int counter;
public:
//status
short stat;
bool entrance;
bool exit;
static const short CLEAN;
static const short CYCLESEARCH;
static const short CYCLEFIN;
static const short CYCLE;
static const short PATH;
static const short PATHFIN;
static const short DETECT;
static const short FINISHED;
static const short CC;
static const short SCC;
static const short SCCFin;
//init
void init(std::pair<std::string, long unsigned int*> );
void addSuc(Vertex*);
void addPre(Vertex*);
void resetCounter();
//access data
void print();
void printE();
bool isSource();
bool isSink();
Neighbor preIt();
Neighbor succIt();
std::string getID();
//change and access vertex data
void setNext(Vertex*);
Vertex* getNext();
void setmaxParent(Vertex*);
Vertex* getmaxParent();
void setCmin(Vertex*);
Vertex* getCmin();
void setCmax(Vertex*);
Vertex* getCmax();
//change and access vertex integer data
void setCyclePos(long unsigned int);
long unsigned int getCyclePos();
void setPostorderPos(long unsigned int);
long unsigned int getPostorderPos();
void setLowlink(long unsigned int);
long unsigned int getLowlink();
void setPaths(long unsigned int);
long unsigned int getPaths();
};
std::vector<Vertex> readEdgeList(Config&);
#endif