-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsolution.cpp
More file actions
48 lines (43 loc) · 1.06 KB
/
solution.cpp
File metadata and controls
48 lines (43 loc) · 1.06 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
#include "solution.hpp"
/*
csce::solution::solution(edge_set &edgeset, std::string f) {
std::ifstream infile(f.c_str());
if (infile.is_open())
{
infile >> numberOfVertices;
infile >> numberOfEdges;
infile >> numberOfSolutions;
int a, b;
for (int i = 0; i < numberOfEdges; i++)
{
infile >> a >> b;
csce::vertex vertex_a(a);
csce::vertex vertex_b(b);
edgeset.add(csce::edge(vertex_a, vertex_b));
// somehow populate the vertices vector of g? FIXME
}
for (int i = 0; i < numberOfSolutions; i++) {
infile >> numberOfSolutionsForPerfectMatching;
std::vector<csce::edge> row;
for (int j = 0; j < numberOfSolutionsForPerfectMatching; j++) {
infile >> a >> b;
vertex u(a);
vertex v(b);
edge e(u, v);
row.push_back(e);
}
solutionSet.push_back(row);
}
infile.close();
}
}
bool csce::solution::isSolution(edge_set e) {
for (int i = 0; i < numberOfSolutions; i++) {
for (int j = 0; j < numberOfVertices / 2; j++) {
if (!e.contains(solutionSet[i][j]))
return false;
}
}
return true;
}
*/