-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraph.hpp
More file actions
29 lines (23 loc) · 815 Bytes
/
Copy pathgraph.hpp
File metadata and controls
29 lines (23 loc) · 815 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
#include <iostream>
#include <string>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <list>
using namespace std;
class graph{
protected:
map<string, map<string, double>> _graph;
set<string> _nodes;
map<string,set<string>> _outEdges;
public:
set<string> &_nodes(){}
map<string, map<string, double>> &_graph();
graph(map<string, map<string, double>> graph, set<string> nodes):_graph(graph), _nodes(nodes){};
void addNode(const string &_node);
void addEdge(const string &src, const string &dst, double weight);
double getWeight(const string &src, const string &dst);
list<string> bfs(const string &src, const string &dest);
double ThereIsPath(const string &src, const string &dest);
};