forked from CipherYuvraj/Algorithm-Visualiser-Platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraph_models.h
More file actions
54 lines (44 loc) · 1.42 KB
/
graph_models.h
File metadata and controls
54 lines (44 loc) · 1.42 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
45
46
47
48
49
50
51
52
53
54
#pragma once
#include <vector>
#include <string>
#include <unordered_map>
struct GraphNode {
int id;
std::string label;
double x, y;
std::string color;
GraphNode(int id, const std::string& label = "", double x = 0.0, double y = 0.0, const std::string& color = "white");
};
struct GraphEdge {
int from, to;
double weight;
bool directed;
std::string color;
GraphEdge(int from, int to, double weight = 1.0, bool directed = false, const std::string& color = "black");
};
struct GraphStep {
std::vector<int> visitedNodes;
std::vector<int> currentNodes;
std::vector<std::pair<int, int>> visitedEdges;
std::vector<std::pair<int, int>> currentEdges;
std::unordered_map<int, double> distances;
std::unordered_map<int, int> parents;
std::string operation;
GraphStep(const std::string& operation);
};
struct SortingStep {
std::vector<int> array;
std::vector<int> highlighted;
std::vector<int> comparing;
std::string operation;
int operations_count;
std::string time_complexity;
std::string space_complexity;
SortingStep(const std::vector<int>& array,
const std::vector<int>& highlighted,
const std::vector<int>& comparing,
const std::string& operation,
int operations_count,
const std::string& time_complexity,
const std::string& space_complexity);
};