-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGraph.h
30 lines (26 loc) · 819 Bytes
/
Graph.h
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
#pragma once
#include <vector>
#include "Precinct.h"
using std::string;
using std::vector;
class Graph {
public:
Graph();
Graph(string filename);
void loadFromFile(string filename);
const vector<Precinct>& getPrecincts();
void setPrecincts(vector<Precinct> precincts);
const vector<vector<int>>& getEdges();
void setEdges(vector<vector<int>> edges);
int numPrecincts();
// write BFS to a file to find node distance
int BFS(unsigned start, unsigned end);
private:
/*
nodes are uniquely identified by id/number
precincts, being vertexes, connected by edges
*/
vector<Precinct> precincts;
// edges between precincts and connecting them
vector<vector<int>> edges;
};