forked from lucasmoura/SimpleGraph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraph.h
More file actions
38 lines (28 loc) · 689 Bytes
/
graph.h
File metadata and controls
38 lines (28 loc) · 689 Bytes
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
#ifndef GRAPH_H
#define GRAPH_H
#include <map>
#include <ostream>
#include "vertex.h"
class Graph
{
friend std::ostream& operator<<(std::ostream& os, Graph* graph);
public:
static const int VERTEX_ALREADY_IN_GRAPH;
static const int VERTEX_INSERTED_ON_GRAPH;
static const int VERTEX_NOT_FOUND;
static const int EDGE_INSERTED_ON_GRAPH;
static const int VERTEX_FOUND;
Graph();
~Graph();
int getNumVertex() const;
Vertex* getVertex(int);
int addVertex(int);
int addEdge(int, int, int);
int depthFirstSearch(int, int);
int breadthFirstSearch(int, int);
private:
std::map<int, Vertex*> vertexMap;
int numVertex;
bool isVertexInGraph(int);
};
#endif