Fishnet 2.0.1
Framework for Graph-Based Analysis of GIS Vector Data
Loading...
Searching...
No Matches
Contraction.hpp File Reference
#include "BFSAlgorithm.hpp"
#include <future>
#include <mutex>
#include <numeric>
#include <type_traits>
#include <chrono>
#include <unordered_set>
#include <fishnet/GraphModel.hpp>
#include <fishnet/CollectionConcepts.hpp>
Include dependency graph for Contraction.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  fishnet
 
namespace  fishnet::graph
 

Functions

template<Graph SourceGraphType, Graph TargetGraphType>
void fishnet::graph::contract (const SourceGraphType &source, util::BiPredicate< typename SourceGraphType::node_type > auto const &contractBiPredicate, util::BiFunction< typename SourceGraphType::node_type, typename SourceGraphType::node_type, typename TargetGraphType::node_type > auto const &mergeFunction, util::UnaryFunction< typename SourceGraphType::node_type, typename TargetGraphType::node_type > auto const &mapper, TargetGraphType &output, u_int8_t workers=1)
 Performs edge contraction algorithm. Edges between nodes fulfilling the contractBiPredicate get contracted. The incident nodes get merged by first mapping to the node type of the result graph and combining them using the mergeFunction Source graph is not changed, target graph is cleared before inserting the contraction result.
 
template<Graph SourceGraphType, Graph TargetGraphType>
void fishnet::graph::contract (const SourceGraphType &source, util::BiPredicate< typename SourceGraphType::node_type > auto const &contractBiPredicate, util::ReduceFunction< std::vector< typename SourceGraphType::node_type >, typename TargetGraphType::node_type > auto const &reduceFunction, TargetGraphType &output, u_int8_t workers=1)
 Performs edge contraction algorithm. Edges between nodes fulfilling the contractBiPredicate get contracted. The incident nodes get merge by reducing a vector of nodes from the source graph to a single node of the target graph. Source graph is not changed, target graph is cleared before inserting the contraction result.
 
template<Graph SourceGraphType, Graph TargetGraphType>
void fishnet::graph::contractInPlace (SourceGraphType &source, util::BiPredicate< typename SourceGraphType::node_type > auto const &contractBiPredicate, util::ReduceFunction< std::vector< typename SourceGraphType::node_type >, typename TargetGraphType::node_type > auto const &reduceFunction, TargetGraphType &output, u_int8_t workers=1)
 Performs edge contraction algorithm. Edges between nodes fulfilling the contractBiPredicate get contracted. The incident nodes get merge by reducing a vector of nodes from the source graph to a single node of the target graph. Source graph is not changed, target graph is cleared before inserting the contraction result.
 
template<Graph SourceGraphType>
void fishnet::graph::contractInPlace (SourceGraphType &graph, util::BiPredicate< typename SourceGraphType::node_type > auto const &contractBiPredicate, util::ReduceFunction< std::vector< typename SourceGraphType::node_type >, typename SourceGraphType::node_type > auto const &reduceFunction, u_int8_t workers=1)
 In place edge contraction implementation. Edges between nodes fulfilling the contractBiPredicate get contracted. The incident nodes get merged by reducing a vector of nodes from the source graph to a single node of the target graph. Source graph is cleared and filled with the contraction result.
 
template<Graph G>
requires std::is_constructible_v<G>
G fishnet::graph::contract (const G &source, fishnet::util::BiPredicate< typename G::node_type > auto const &contractBiPredicate, fishnet::util::BiOperator< typename G::node_type > auto const &mergeFunction, u_int8_t workers=1)
 Contract the graph depending on the contraction predicate, applying the merge function on the nodes of contracted edges.
 
template<Graph G>
requires std::is_constructible_v<G>
G fishnet::graph::contract (const G &source, fishnet::util::BiPredicate< typename G::node_type > auto const &contractBiPredicate, fishnet::util::ReduceFunction< std::vector< typename G::node_type > > auto const &reduceFunction, u_int8_t workers=1)
 Contract the graph depending on the contraction predicate, applying the reduce function to merge clustered nodes.