Adds a special graph for MLD with effcient boundary scan

This graph enables efficient boundary edge scans at each level.
Currenly this needs about |V|*|L| bytes of storage.
We can optimize this when the highest boundary nodes ID is << |V|.
This commit is contained in:
Patrick Niklaus
2017-03-07 03:59:28 +00:00
committed by Patrick Niklaus
parent 58681fa7ea
commit 655ca803d8
12 changed files with 518 additions and 131 deletions
+12 -21
View File
@@ -3,6 +3,7 @@
#include "extractor/edge_based_edge.hpp"
#include "partition/edge_based_graph.hpp"
#include "partition/multi_level_graph.hpp"
#include "util/static_graph.hpp"
#include "util/typedefs.hpp"
@@ -13,34 +14,24 @@ namespace osrm
namespace customizer
{
struct StaticEdgeBasedGraph;
namespace io
{
void read(const boost::filesystem::path &path, StaticEdgeBasedGraph &graph);
void write(const boost::filesystem::path &path, const StaticEdgeBasedGraph &graph);
}
using EdgeBasedGraphEdgeData = partition::EdgeBasedGraphEdgeData;
struct StaticEdgeBasedGraph : util::StaticGraph<EdgeBasedGraphEdgeData>
struct MultiLevelEdgeBasedGraph : public partition::MultiLevelGraph<EdgeBasedGraphEdgeData, false>
{
using Base = util::StaticGraph<EdgeBasedGraphEdgeData>;
using Base::Base;
friend void io::read(const boost::filesystem::path &path, StaticEdgeBasedGraph &graph);
friend void io::write(const boost::filesystem::path &path, const StaticEdgeBasedGraph &graph);
};
struct StaticEdgeBasedGraphView : util::StaticGraph<EdgeBasedGraphEdgeData, true>
{
using Base = util::StaticGraph<EdgeBasedGraphEdgeData, true>;
using Base = partition::MultiLevelGraph<EdgeBasedGraphEdgeData, false>;
using Base::Base;
};
struct StaticEdgeBasedGraphEdge : StaticEdgeBasedGraph::InputEdge
struct MultiLevelEdgeBasedGraphView
: public partition::MultiLevelGraph<EdgeBasedGraphEdgeData, true>
{
using Base = StaticEdgeBasedGraph::InputEdge;
using Base = partition::MultiLevelGraph<EdgeBasedGraphEdgeData, true>;
using Base::Base;
};
struct StaticEdgeBasedGraphEdge : MultiLevelEdgeBasedGraph::InputEdge
{
using Base = MultiLevelEdgeBasedGraph::InputEdge;
using Base::Base;
};
}
-18
View File
@@ -11,24 +11,6 @@ namespace customizer
{
namespace io
{
inline void read(const boost::filesystem::path &path, StaticEdgeBasedGraph &graph)
{
const auto fingerprint = storage::io::FileReader::VerifyFingerprint;
storage::io::FileReader reader{path, fingerprint};
reader.DeserializeVector(graph.node_array);
reader.DeserializeVector(graph.edge_array);
}
inline void write(const boost::filesystem::path &path, const StaticEdgeBasedGraph &graph)
{
const auto fingerprint = storage::io::FileWriter::GenerateFingerprint;
storage::io::FileWriter writer{path, fingerprint};
writer.SerializeVector(graph.node_array);
writer.SerializeVector(graph.edge_array);
}
}
}
}