-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakeGraph.h
More file actions
45 lines (41 loc) · 1.13 KB
/
makeGraph.h
File metadata and controls
45 lines (41 loc) · 1.13 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
#pragma once
#include "parseDat.h"
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <iterator>
#include <map>
#include <stdexcept>
#include <stdlib.h>
#include <string>
#include <vector>
#include <algorithm>
#include <unordered_map>
using namespace std;
struct Airport {
int airportID;
long double latitude;
long double longitude;
};
class makeGraph {
public:
makeGraph();
makeGraph(unordered_map<int, int> a, unordered_map<int, vector<int>> n, vector<vector<double>> g);
int getAirportIndex(int key);
Airport getAirports(int key);
vector<vector<double>>& getGraph();
void addEdge(int sourceAirID, int destAirID);
void deleteEdge(int sourceAirID, int destAirID);
bool edgeExists(int sourceAirID, int destAirID);
double routeDistance(int source_idx, int dest_idx);
void populateGraph();
vector<int> getNeighbors(int index);
int getAirportID(int index);
size_t getGraphSize();
double distance(double lata, double latb, double longa, double longb);
private:
unordered_map<int, int> airport_index;
unordered_map<int, vector<int>> neighbors;
vector<vector<double>> graph;
vector<Airport> airports;
};