-
Notifications
You must be signed in to change notification settings - Fork 1
/
graph.h
43 lines (33 loc) · 774 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
#ifndef __GRAPH__H__
#define __GRAPH__H__
#pragma once
#include "vertex.h"
#include "edge.h"
#include <string>
#include <vector>
#include <list>
#include <map>
#include <iostream>
#define INF 0x3f3f3f3f
using namespace std;
typedef map<int, Vertex> VertexSet;
typedef map<pair<int, int>, Edge> EdgeSet;
extern int t; //for time of discovery
class Graph {
private:
map <int, Vertex> V; //set of Vertexes
map <pair<int, int>, Edge> E; //set of Edges
int n; //number of vertex
int m; //number of edges
int **adjmat; //matrix of adjancency
public:
Graph();
bool loadGraphFromFile(const char* fileName);
void printGraphInfo();
void clearVertex();
void DFS();
void DFSV(Vertex v);
void BFS(Vertex start);
VertexSet getVertexSet();
};
#endif