Skip to content

Commit 09336f8

Browse files
committed
testing logged data
1 parent 7a275a1 commit 09336f8

File tree

4 files changed

+2637
-6
lines changed

4 files changed

+2637
-6
lines changed

include/dijkstraTRSP/pgr_dijkstraTRSP.hpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ void Pgr_dijkstraTRSP< G >::getFirstSolution(G& graph) {
101101

102102
template < class G >
103103
bool Pgr_dijkstraTRSP< G >::checkFirstSolution() {
104+
#if 0
104105
auto sort_cmp = [](const std::pair<int64_t, Restrict_t>& left,
105106
const std::pair<int64_t, Restrict_t>& right) -> bool {
106107
return left.first <= right.first;
@@ -113,6 +114,7 @@ bool Pgr_dijkstraTRSP< G >::checkFirstSolution() {
113114
sort_cmp);
114115
std::vector< int64_t > edges_in_path;
115116
for (auto &path: curr_result_path) edges_in_path.push_back(path.edge);
117+
if (edges_in_path.size() and edges_in_path[0] == -1) reverse(edges_in_path.begin(), edges_in_path.end());
116118
while (edges_in_path.size() and edges_in_path.back() == -1) edges_in_path.pop_back();
117119
size_t index = 0;
118120
for (auto &edge: edges_in_path) {
@@ -127,21 +129,25 @@ bool Pgr_dijkstraTRSP< G >::checkFirstSolution() {
127129
if(edges_in_path[temp_edge_index] != edge_id) okay = false;
128130
temp_edge_index++;
129131
}
130-
if(okay)
132+
if (okay) {
133+
log << "Restriction is not applicable to this case.";
131134
return false;
135+
}
132136
edge_index++;
133137
}
134138
index++;
135139
}
136-
return true;
140+
#endif
141+
log << "Restriction is applicable to this case.";
142+
return false;
137143
}
138144

139145
template < class G >
140146
void Pgr_dijkstraTRSP< G >::executeDijkstraTRSP(G& graph) {
141147
clear();
142148
getFirstSolution(graph);
149+
log << curr_result_path;
143150
bool sol = checkFirstSolution();
144-
std::cout<<sol<<"\n";
145151
if (sol)
146152
curr_result_path = Path();
147153
}

0 commit comments

Comments
 (0)