必应地图推出最新路径分析引擎

必应地图推出最新路径分析引擎

参考链接:

http://www.bing.com/community/site_blogs/b/maps/archive/2012/01/05/bing-maps-new-routing-engine.aspx

                                                      Bing Maps New Routing Engine

                                                                                                                                     Chris Pendleton

 

Did you happen to notice the new routing engine we implemented on Bing Maps? No? I suppose that’s a good thing since your service was never interrupted. However, I can tell you that we’re enjoying the reduced latency, high performance, low overhead benefits of a new route calculation algorithm that changes the game in how driving directions queries are computed. It started when I took over as PM of backend services for Bing Maps. The Microsoft Research team presented this crazy new idea to replace our modified Dijkstra's algorithm with the blandly named “Customizable Route Planning” algo. We’ve been using our own modified Dijkstra for years, it’s done a great job and it’s flexible – so, why would we change that? Once we saw the calculation numbers it was a no brainer to begin implementation immediately. For any of our route calculations we’re now processing requests twice as fast as we ever have. Oh, snaps! Now, if only CRP could double the speed limit. Future enhancement!

The CRP routing engine comes with some special sauce too. We exposed a feature in the API for alternate routes, so when you’d like to see additional options for the route you can request up to 3 routes in one request using the maxSolutions method. You can then display them on the map for visual reference.

So, how does it work? Well, it’s 3 major steps: Preprocessing. More preprocessing. Then, real time query calculation. Easy, right?! Here’s an excerpt from the CRP

Basic Algorithm. Our metric-independent preprocessing stage partitions the graph into connected cells with at most U (an input parameter) vertices each, with as few boundary arcs (arcs with endpoints in di erent cells) as possible. The metric customization stage builds a graph H containing all boundary vertices (those with at least one neighbor in another cell) and boundary arcs of G. It also contains a clique for each cell C: for every pair (v;w) of boundary vertices in C, we create an arc (v;w) whose cost is the same as the shortest path (restricted to C) between v and w (or in nite if w is not reachable from v). We do so by running Dijkstra from each boundary vertex. Note that H is an overlay [24]: the distance between any two vertices in H is the same as in G. Finally, to perform a query between s and t, we run a bidirectional version of Dijkstra's algorithm on the graph consisting of the union of H, Cs, and Ct. (Here Cv denotes the subgraph of G induced by the vertices in the cell containing v.) As already mentioned, this is the basic strategy of separator-based methods. In particular, HiTi [19] uses edge-based separators and cliques to represent each cell. Unfortunately, HiTi has not been tested on large road networks; experiments were limited to small grids, and the original proof of concept does not appear to have been optimized using modern algorithm engineering techniques. Our rst improvement over HiTi and similar algorithms is to use PUNCH [5] to partition the graph. Recently developed to deal with road networks, it routinely nds solutions with half as many boundary edges (or fewer), compared to the general-purpose partitioners (such as METIS [20]) commonly used by previous algorithms. Better partitions reduce customization time and space, leading to faster queries. For our experiments, we used relatively long runs of PUNCH, taking about an hour. Our results would not change much if we used the basic version of PUNCH, which is only about 5% worse but runs in mere minutes. We use parallelism: queries run forward and reverse searches on two CPU cores, and customization uses all four (each cell is processed independently).

If you’re really hardcore, you can read the full paper on the Microsoft Research web site. Special thanks to the Microsoft Research Team - Daniel Delling, Andrew V. Goldberg, Thomas Pajor, and Renato F. Werneck.

CP

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
# RoutingKit [![Build Status](https://travis-ci.org/RoutingKit/RoutingKit.svg?branch=master)](https://travis-ci.org/RoutingKit/RoutingKit) RoutingKit is a C++ library that provides advanced route planning functionality. It was developed at [KIT](https://www.kit.edu) in the [group of Prof. Dorothea Wagner](https://i11www.iti.kit.edu/). The most prominent component is an index-based data structure called (Customizable) Contraction Hierarchy, that allows to answer shortest path queries within milliseconds or even less on data sets of continental size while keeping the arc weights flexible. Such running times cannot be achieved without indices. One of the main design goals of RoutingKit is to make recent research results easily accessible to people developing route planning applications. A key element is an interface that is a good compromise between usability and running time performance. For example the following code snippet is enough to build and query a basic index given an [OSM](https://www.openstreetmap.org) PBF data export. ```cpp #include <routingkit/osm_simple.h> #include <routingkit/contraction_hierarchy.h> #include <routingkit/inverse_vector.h> #include <routingkit/timer.h> #include <routingkit/geo_position_to_node.h> #include <iostream> using namespace RoutingKit; using namespace std; int main(){ // Load a car routing graph from OpenStreetMap-based data auto graph = simple_load_osm_car_routing_graph_from_pbf("file.pbf"); auto tail = invert_inverse_vector(graph.first_out); // Build the shortest path index auto ch = ContractionHierarchy::build( graph.node_count(), tail, graph.head, graph.travel_time ); // Build the index to quickly map latitudes and longitudes GeoPositionToNode map_geo_position(graph.latitude, graph.longitude); // Besides the CH itself we need a query object. ContractionHierarchyQuery ch_query(ch); // Use the query object to answer queries from stdin to stdout float from_latitude, from_longitude, to_latitude, to
# CRP Open source C++ Implementation of Customizable Route Planning (CRP) by Delling et al. This project was part of a practical course at Karlsruhe Institute of Technology (KIT). Requirements ============ In order to build CRP you need to have the following software installed: - Boost C++ Library (http://www.boost.org), more specifically Boost Iostreams. - Scons (http://scons.org) - g++ >= 4.8 (https://gcc.gnu.org) Building CRP ============ If the Boost Library is not in your PATH, make sure to edit the *SConstruct* file in the root directory to point the build script to the correct location of Boost. There is a section *Libraries* in the *SConstruct* file where you can specify the paths. Once you have installed all the software packages listed above, you can build the CRP programs by typing ``` scons --target=CRP --optimize=Opt -jX ``` into your terminal where `X` is the number of cores you want to use for building the project. If you want to use a specific g++ compiler version you can add `--compiler=g++-Version`. We also support a debug and profiling build that you can call with `--optimize=Dbg` and `--optimize=Pro` respectively. This command will build three programs in the folder *deploy*: - *osmparser*: Used to parse an OpenStreetMap (OSM) bz2-compressed map file. Call it with `./deploy/osmparser path_to_osm.bz2 path_to_output.graph.bz2` - *precalculation*: Used to build an overlay graph based on a given partition. Call it with `./deploy/precalculation path_to_graph path_to_mlp output_directory`. Here, *path_to_mlp* is the path to a *MultiLevelPartition* file for the graph that you need to provide. For more details, take a look into our project documentation. - *customization*: Used to precompute the metric weights for the overlay graph. Call it with `./deploy/customization path_to_graph path_to_overlay_graph metric_output_directory metric_type`. We currently support the following metric types: *hop* (number of edges traversed), *time* and *dist*.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值