-
Notifications
You must be signed in to change notification settings - Fork 1
/
graph.hpp
30 lines (24 loc) · 845 Bytes
/
graph.hpp
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
#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:
bool checkExist(const string& node);
void print(std::list<std::string> const &list);
double getConv(const string &src, const string &dst);
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);
};