Move TarjanSCC from extractor to util (#6562)
This commit is contained in:
parent
a63ba91c8f
commit
0e7c3d8ad4
@ -10,7 +10,7 @@
|
||||
namespace osrm::util
|
||||
{
|
||||
|
||||
// This Wrapper provides all methods that are needed for extractor::TarjanSCC, when the graph is
|
||||
// This Wrapper provides all methods that are needed for util::TarjanSCC, when the graph is
|
||||
// given in a matrix representation (e.g. as output from a distance table call)
|
||||
|
||||
template <typename T> class MatrixGraphWrapper
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <stack>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm::extractor
|
||||
namespace osrm::util
|
||||
{
|
||||
|
||||
template <typename GraphT> class TarjanSCC
|
||||
@ -178,6 +178,6 @@ template <typename GraphT> class TarjanSCC
|
||||
|
||||
unsigned GetComponentID(const NodeID node) const { return components_index[node]; }
|
||||
};
|
||||
} // namespace osrm::extractor
|
||||
} // namespace osrm::util
|
||||
|
||||
#endif /* TARJAN_SCC_HPP */
|
@ -16,7 +16,6 @@
|
||||
#include "extractor/restriction_graph.hpp"
|
||||
#include "extractor/restriction_parser.hpp"
|
||||
#include "extractor/scripting_environment.hpp"
|
||||
#include "extractor/tarjan_scc.hpp"
|
||||
#include "extractor/turn_path_filter.hpp"
|
||||
#include "extractor/way_restriction_map.hpp"
|
||||
|
||||
@ -31,6 +30,7 @@
|
||||
#include "util/log.hpp"
|
||||
#include "util/static_graph.hpp"
|
||||
#include "util/static_rtree.hpp"
|
||||
#include "util/tarjan_scc.hpp"
|
||||
#include "util/timing_util.hpp"
|
||||
|
||||
// Keep debug include to make sure the debug header is in sync with types.
|
||||
@ -699,7 +699,7 @@ void Extractor::FindComponents(unsigned number_of_edge_based_nodes,
|
||||
|
||||
auto uncontracted_graph = UncontractedGraph(number_of_edge_based_nodes, edges);
|
||||
|
||||
TarjanSCC<UncontractedGraph> component_search(uncontracted_graph);
|
||||
util::TarjanSCC<UncontractedGraph> component_search(uncontracted_graph);
|
||||
component_search.Run();
|
||||
|
||||
for (NodeID node_id = 0; node_id < number_of_edge_based_nodes; ++node_id)
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "partitioner/recursive_bisection_state.hpp"
|
||||
#include "extractor/tarjan_scc.hpp"
|
||||
#include "partitioner/tarjan_graph_wrapper.hpp"
|
||||
#include "util/tarjan_scc.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <climits> // for CHAR_BIT
|
||||
@ -89,7 +89,7 @@ RecursiveBisectionState::PrePartitionWithSCC(const std::size_t small_component_s
|
||||
// since our graphs are unidirectional, we don't realy need the scc. But tarjan is so nice and
|
||||
// assigns IDs and counts sizes
|
||||
TarjanGraphWrapper wrapped_graph(bisection_graph);
|
||||
extractor::TarjanSCC<TarjanGraphWrapper> scc_algo(wrapped_graph);
|
||||
util::TarjanSCC<TarjanGraphWrapper> scc_algo(wrapped_graph);
|
||||
scc_algo.Run();
|
||||
|
||||
// Map Edges to Sccs
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include "extractor/files.hpp"
|
||||
#include "extractor/packed_osm_ids.hpp"
|
||||
#include "extractor/tarjan_scc.hpp"
|
||||
|
||||
#include "util/coordinate.hpp"
|
||||
#include "util/coordinate_calculation.hpp"
|
||||
@ -8,6 +7,7 @@
|
||||
#include "util/fingerprint.hpp"
|
||||
#include "util/log.hpp"
|
||||
#include "util/static_graph.hpp"
|
||||
#include "util/tarjan_scc.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
@ -145,7 +145,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
util::Log() << "Starting SCC graph traversal";
|
||||
|
||||
extractor::TarjanSCC<tools::TarjanGraph> tarjan{*graph};
|
||||
util::TarjanSCC<tools::TarjanGraph> tarjan{*graph};
|
||||
tarjan.Run();
|
||||
|
||||
util::Log() << "Identified: " << tarjan.GetNumberOfComponents() << " components";
|
||||
|
Loading…
Reference in New Issue
Block a user