@@ -138,6 +138,7 @@ void ContractNode(ContractorThreadData *data,
138
138
const ContractorGraph &graph,
139
139
const NodeID node,
140
140
std::vector<EdgeWeight> &node_weights,
141
+ const std::vector<bool > &contractable,
141
142
ContractionStats *stats = nullptr )
142
143
{
143
144
auto &heap = data->heap ;
@@ -245,12 +246,12 @@ void ContractNode(ContractorThreadData *data,
245
246
if (RUNSIMULATION)
246
247
{
247
248
const int constexpr SIMULATION_SEARCH_SPACE_SIZE = 1000 ;
248
- search (heap, graph, number_of_targets, SIMULATION_SEARCH_SPACE_SIZE, max_weight, node);
249
+ search (heap, graph, contractable, number_of_targets, SIMULATION_SEARCH_SPACE_SIZE, max_weight, node);
249
250
}
250
251
else
251
252
{
252
253
const int constexpr FULL_SEARCH_SPACE_SIZE = 2000 ;
253
- search (heap, graph, number_of_targets, FULL_SEARCH_SPACE_SIZE, max_weight, node);
254
+ search (heap, graph, contractable, number_of_targets, FULL_SEARCH_SPACE_SIZE, max_weight, node);
254
255
}
255
256
for (auto out_edge : graph.GetAdjacentEdgeRange (node))
256
257
{
@@ -344,18 +345,20 @@ void ContractNode(ContractorThreadData *data,
344
345
void ContractNode (ContractorThreadData *data,
345
346
const ContractorGraph &graph,
346
347
const NodeID node,
347
- std::vector<EdgeWeight> &node_weights)
348
+ std::vector<EdgeWeight> &node_weights,
349
+ const std::vector<bool > &contractable)
348
350
{
349
- ContractNode<false >(data, graph, node, node_weights, nullptr );
351
+ ContractNode<false >(data, graph, node, node_weights, contractable, nullptr );
350
352
}
351
353
352
354
ContractionStats SimulateNodeContraction (ContractorThreadData *data,
353
355
const ContractorGraph &graph,
354
356
const NodeID node,
355
- std::vector<EdgeWeight> &node_weights)
357
+ std::vector<EdgeWeight> &node_weights,
358
+ const std::vector<bool > &contractable)
356
359
{
357
360
ContractionStats stats;
358
- ContractNode<true >(data, graph, node, node_weights, &stats);
361
+ ContractNode<true >(data, graph, node, node_weights, contractable, &stats);
359
362
return stats;
360
363
}
361
364
@@ -487,7 +490,7 @@ bool UpdateNodeNeighbours(ContractorNodeData &node_data,
487
490
if (node_data.contractable [u])
488
491
{
489
492
node_data.priorities [u] = EvaluateNodePriority (
490
- SimulateNodeContraction (data, graph, u, node_data.weights ), node_data.depths [u]);
493
+ SimulateNodeContraction (data, graph, u, node_data.weights , node_data. contractable ), node_data.depths [u]);
491
494
}
492
495
}
493
496
return true ;
@@ -627,7 +630,7 @@ std::vector<bool> contractGraph(ContractorGraph &graph,
627
630
auto node = remaining_nodes[x].id ;
628
631
BOOST_ASSERT (node_data.contractable [node]);
629
632
node_data.priorities [node] = EvaluateNodePriority (
630
- SimulateNodeContraction (data, graph, node, node_data.weights ),
633
+ SimulateNodeContraction (data, graph, node, node_data.weights , node_data. contractable ),
631
634
node_data.depths [node]);
632
635
}
633
636
});
@@ -688,7 +691,7 @@ std::vector<bool> contractGraph(ContractorGraph &graph,
688
691
for (auto position = range.begin (), end = range.end (); position != end; ++position)
689
692
{
690
693
const NodeID node = remaining_nodes[position].id ;
691
- ContractNode (data, graph, node, node_data.weights );
694
+ ContractNode (data, graph, node, node_data.weights , node_data. contractable );
692
695
}
693
696
});
694
697
0 commit comments