21 #ifndef FMM_NETWORK_GRAPH_HPP
22 #define FMM_NETWORK_GRAPH_HPP
24 #include "network/heap.hpp"
25 #include "network/graph.hpp"
26 #include "network/network.hpp"
Graph_T g
The member storing a boost graph.
boost::adjacency_list< boost::vecS, boost::vecS, boost::directedS, boost::no_property, EdgeProperty > Graph_T
Boost graph type.
void print_graph() const
Print graph information.
const FMM::CORE::Point & get_vertex_point(NodeIndex u) const
Get node geometry.
const FMM::CORE::Point & get_vertex_point(NodeIndex u) const
Get node point from node index.
const Network & network
Road network.
std::vector< EdgeIndex > shortest_path_astar(NodeIndex source, NodeIndex target) const
AStar Shortest path query from source to target.
std::unordered_map< NodeIndex, double > DistanceMap
Distance map.
void single_source_upperbound_dijkstra(NodeIndex source, double delta, PredecessorMap *pmap, DistanceMap *dmap) const
Single source shortest path query with an uppper bound.
int get_edge_id(EdgeIndex idx) const
Get the edge ID from edge index.
NodeID get_node_id(NodeIndex index) const
Get node ID from index.
const Network & get_network()
Get inner network reference.
NodeIndex get_node_index(NodeID id) const
Get node index from id.
const Graph_T & get_boost_graph() const
Get inner boost graph.
EdgeID get_edge_id(EdgeIndex index) const
Get edge ID from index.
static constexpr double DOUBLE_MIN
A value used in checking edge from source,target and cost.
NetworkGraph(const Network &network_arg)
Construct a network graph from a network.
unsigned int get_num_vertices() const
Get number of vertices in the graph.
unsigned int num_vertices
number of vertices
Graph class of the network.
int NodeID
Node ID in the network, can be discontinuous int.
int get_edge_index(NodeIndex source, NodeIndex target, double cost) const
Find the edge ID given a pair of nodes and its cost, if not found, return -1.
int get_node_id(NodeIndex idx) const
Get node ID from a node index.
std::vector< EdgeIndex > shortest_path_dijkstra(NodeIndex source, NodeIndex target) const
Dijkstra Shortest path query from source to target.
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 ].
double calc_heuristic_dist(const CORE::Point &p1, const CORE::Point &p2) const
Calculate heuristic distance from p1 to p2,which is used in Astar routing.
boost::geometry::model::point< double, 2, boost::geometry::cs::cartesian > Point
Point class.
int get_edge_id(NodeIndex source, NodeIndex target, double cost) const
Get edge ID from source node, target node and cost.
std::unordered_map< NodeIndex, NodeIndex > PredecessorMap
Predecessor Map.
NodeIndex get_node_index(NodeID id) const
Get node index from node ID.
std::vector< EdgeIndex > back_track(NodeIndex source, NodeIndex target, const PredecessorMap &pmap, const DistanceMap &dmap) const
Backtrack the routing result to find a path from source to target.