* @brief Post-process an independent node after contraction * * - Algo 2: Move I to their Level * * @param graph * @param v * @param node_data */
| 387 | * @param node_data |
| 388 | */ |
| 389 | void PostProcess(ContractorGraph &graph, const NodeID v, ContractorNodeData &node_data) |
| 390 | { |
| 391 | ContractorNodeData::NodeDepth depth = node_data.depths[v] + 1; |
| 392 | for (const NodeID u : GetNeighbours(graph, v)) |
| 393 | { |
| 394 | node_data.depths[u] = std::max(depth, node_data.depths[u]); |
| 395 | |
| 396 | // "Irrespective of the direction flags, each edge (u, v) is stored only once, |
| 397 | // namely at the smaller node, which complies with the requirements of both |
| 398 | // forward and backward search (including the stall-on-demand technique)." |
| 399 | // [Geisberger2008] |
| 400 | // See also: self-loops |
| 401 | graph.DeleteEdgesTo(u, v); |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | /** |
| 406 | * @brief Inserts the edges produced by node contraction into the graph. |
no test coverage detected