30 #ifndef INCLUDE_CONTRACTION_PGR_DEADENDCONTRACTION_HPP_
31 #define INCLUDE_CONTRACTION_PGR_DEADENDCONTRACTION_HPP_
42 namespace contraction {
60 for (
const auto v : boost::make_iterator_range(vertices(graph.graph))) {
68 if (graph.is_undirected()) {
69 return graph.find_adjacent_vertices(v).size() == 1;
74 return graph.find_adjacent_vertices(v).size() == 1
75 || (graph.in_degree(v) > 0 && graph.out_degree(v) == 0);
87 for (
auto u : graph.find_adjacent_vertices(v)) {
93 auto v2(graph.get_min_cost_edge(u, v));
94 graph[u].contracted_vertices() += std::get<1>(v2);
95 graph[u].contracted_vertices() += graph[v].id;
96 graph[u].contracted_vertices() += graph[v].contracted_vertices();
102 graph[v].contracted_vertices().
clear();
103 boost::clear_vertex(v, graph.graph);
106 CHECK_FOR_INTERRUPTS();
108 for (
const auto u : local) {
126 #endif // INCLUDE_CONTRACTION_PGR_DEADENDCONTRACTION_HPP_