-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraph.h
More file actions
44 lines (37 loc) · 1.23 KB
/
Copy pathGraph.h
File metadata and controls
44 lines (37 loc) · 1.23 KB
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
#ifndef GCALC_GRAPH_H
#define GCALC_GRAPH_H
#include <set>
#include <memory>
#include <string>
#include "./Vertex.h"
using std::shared_ptr;
namespace gcalc
{
class Graph
{
public:
std::string name;
shared_ptr<std::set<shared_ptr<Vertex>>> vertices;
shared_ptr<std::set<std::pair<shared_ptr<Vertex>, shared_ptr<Vertex>>>> edges;
Graph(std::string graphName);
~Graph() = default;
Graph(const Graph &g);
Graph operator=(Graph g);
Graph operator+(Graph g);
Graph operator^(Graph g);
Graph operator-(Graph g);
Graph operator*(Graph g);
Graph operator!();
void add_vertex(shared_ptr<Vertex> v);
void add_edge(shared_ptr<Vertex> v1, shared_ptr<Vertex> v2);
void add_vertex(Vertex v);
void add_edge(Vertex v1, Vertex v2);
void add_edge(std::pair<shared_ptr<Vertex>, shared_ptr<Vertex>> edge);
shared_ptr<Vertex> find_vertex(std::string vertexName);
std::string get_name() const;
bool is_edge_exists(std::pair<shared_ptr<Vertex>, shared_ptr<Vertex>> edge);
bool is_edge_exists(shared_ptr<Vertex> v1, shared_ptr<Vertex> v2);
void print();
};
} // namespace gcalc
#endif