-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraph.h
More file actions
43 lines (35 loc) · 785 Bytes
/
Copy pathGraph.h
File metadata and controls
43 lines (35 loc) · 785 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
39
40
41
42
43
#pragma once
#include <string>
#define MAX_CITIES 20
const int INF = 99999999;
std::string getCityName(int index);
struct Node {
int adj;
int weight;
Node* next;
};
typedef Node* NODEPTR;
class DynamicGraph {
public:
int numVertices;
int edgeCount;
NODEPTR adjList[MAX_CITIES];
DynamicGraph(int v);
~DynamicGraph();
void addEdge(int u, int v, int w);
int getWeight(int u, int v);
};
class StaticGraph {
public:
int numVertices;
int g[MAX_CITIES][MAX_CITIES];
StaticGraph(int v);
void addEdge(int u, int v, int w);
};
struct RouteResult {
int path[MAX_CITIES + 1] = { 0 };
int pathLen = 0;
int cost = INF;
std::string algoName = "";
long long timeTaken = 0;
};