11 #ifndef FMM_COMPOSITEGRAPH_HPP
12 #define FMM_COMPOSITEGRAPH_HPP
14 #include "network/network_graph.hpp"
119 static constexpr
double DOUBLE_MIN = 1e-6;
121 std::vector<NETWORK::NodeIndex> external_index_vec;
122 std::unordered_map<NETWORK::NodeIndex, DummyIndex> internal_index_map;
173 unsigned int num_vertices;
int get_edge_index(NETWORK::NodeIndex source, NETWORK::NodeIndex target, double cost) const
Get the edge index in the original network graph.
void print_node_index_map() const
Print the mapping from dummy index to node index.
boost::adjacency_list< boost::vecS, boost::vecS, boost::directedS, boost::no_property, EdgeProperty > Graph_T
Boost graph type.
std::vector< Point_Candidates > Traj_Candidates
trajectory candidates
NETWORK::NodeIndex get_external_index(DummyIndex inner_index) const
Get the NodeIndex of a node according to the inner index of the dummy graph.
DummyGraph()
Default constructor of dummy graph.
NETWORK::Graph_T * get_graph_ptr()
Get the inner graph data.
unsigned int get_dummy_node_start_index() const
Get the starting node index corresponding to the the first dummy node in the dummy graph.
int get_edge_index(NETWORK::NodeIndex u, NETWORK::NodeIndex v, double cost) const
Get edge index from node index u,v and cost.
NETWORK::NodeIndex v
Target node index.
void add_edge(NETWORK::NodeIndex source, NETWORK::NodeIndex target, NETWORK::EdgeIndex edge_index, double cost)
Add an edge to the dummy graph.
std::vector< CompEdgeProperty > out_edges(NETWORK::NodeIndex u) const
Get out edges leaving a node u in the composite graph.
int EdgeID
Edge ID in the network, can be discontinuous int.
CompositeGraph(const NETWORK::NetworkGraph &g, const DummyGraph &dg)
Constructor.
Graph class of the network.
const NETWORK::Graph_T & get_boost_graph() const
Get a const reference to the inner graph data.
DummyIndex get_internal_index(NETWORK::NodeIndex external_index) const
Get the internal index of a node in dummy graph If the node is not contained in the dummy graph,...
A graph containing dummy nodes and edges used in map matching.
Composite Graph as a wrapper of network graph and dummy graph.
NETWORK::EdgeID get_edge_id(NETWORK::NodeIndex u, NETWORK::NodeIndex v, double cost) const
Get edge id from node index u,v and cost.
bool containNodeIndex(NETWORK::NodeIndex external_index) const
Check if a node is contained in the dummy graph.
unsigned int NodeIndex
Node Index in the network, range from [0,num_vertices-1 ].
unsigned int EdgeIndex
Edge Index in the network, range from [0,num_edges-1 ].
unsigned int DummyIndex
This is an index used in the dummy graph.
int get_num_vertices() const
Get the number of vertices in the dummy graph.
Property of an edge in the composite graph.
double cost
Cost of an edge.
bool check_dummy_node(NETWORK::NodeIndex u) const
Check if a node u is dummy node, namely representing a candidate point.