27 #ifndef INCLUDE_CHINESE_PGR_CHINESEPOSTMAN_HPP_
28 #define INCLUDE_CHINESE_PGR_CHINESEPOSTMAN_HPP_
53 const size_t totalEdges);
84 std::map<std::pair<int64_t, int64_t>,
91 std::vector<std::pair<int64_t, std::vector<size_t>>>
resultGraph;
110 const size_t totalEdges) :
111 totalDeg(0), totalCost(0), vertices(),
112 edgeToIdx(), originalEdges(),
113 resultGraph(), VToVecid(), edgeVisited(),
114 pathStack(), resultPath(),
115 edges(), sources(), targets() {
121 for (
size_t i = 0; i < totalEdges; ++i) {
122 if (dataEdges[i].cost > 0) {
123 auto edge(dataEdges[i]);
130 if (dataEdges[i].reverse_cost > 0) {
131 auto edge(dataEdges[i]);
145 std::map<int64_t, int> deg;
154 auto current_edge(std::make_pair(e.source, e.target));
158 if (
edgeToIdx[current_edge]->cost > e.cost) {
165 edge.reverse_capacity = -1;
169 edge.capacity = (std::numeric_limits<int32_t>::max)();
182 std::map<int64_t, int>::iterator iter;
184 for (iter = deg.begin(); iter != deg.end(); ++iter) {
185 int64_t p = iter->first;
186 int d = iter->second;
192 edge.reverse_capacity = -1;
230 std::vector<pgr_flow_t> addedEdges = flowGraph.
GetFlowEdges();
232 for (
auto &flow_t : addedEdges) {
235 auto current_edge(std::make_pair(flow_t.source, flow_t.target));
238 while (flow_t.flow--)
resultEdges.push_back(newEdge);
295 newElement.
node = preNode;
296 newElement.
edge = -1;
348 #endif // INCLUDE_CHINESE_PGR_CHINESEPOSTMAN_HPP_