Giter VIP home page Giter VIP logo

crp's Introduction

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:

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. You can compute all metrics with all as metric_type.

Example

Start by calling

./deploy/osmparser examples/karlsruhe/karlsruhe.osm.bz2 examples/karlsruhe/karlsruhe.graph.bz2

This will parse the osm map data for the city of Karlsruhe, Germany and writes the extracted graph.

The next step would be to compute a MultiLevelPartition for the graph. For this example, we already provide one and can directly continue with computing the overlay graph:

./deploy/precalculation examples/karlsruhe/karlsruhe.graph.bz2 examples/karlsruhe/karlsruhe.mlp  examples/karlsruhe/

Note that specifying the same folder as output directory (like in this example) will overwrite the initial graph with a new one containing additional information. Since we do some vertex sorting in this step, you cannot call precalculation on this graph anymore (i.e. first run the osmparser again or choose a different output directory so that the original graph still exists).

In a final step we run the customization phase to build the metric information for the overlay graph:

mkdir examples/karlsruhe/metrics
./deploy/customization examples/karlsruhe/karlsruhe.graph.bz2 examples/karlsruhe/karlsruhe.overlay examples/karlsruhe/metrics/ all

This completes the precomputation steps and CRP is now ready to compute shortest paths.

Building the Tests

You can build some tests to see how CRP performs with the following command:

scons --target=TEST --optimize=Opt

where TEST can be one of the following: QueryTest (runs our three available query algorithms), UnpackPathTest (checks the performance of the PathUnpacker), DijkstraTest (checks that our query algorithms work as expected) and OverlayGraphTest (builds a small overlay graph and performs some sanity tests on it).

The list of required parameters is printed to the terminal by calling the built test program in the deploy folder without any additional arguments.

crp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crp's Issues

How to calculate MultiLevelPartition

Hi Michael

We are trying to use our fine implementation of CRP for our semester project at Aalborg University.
We have got i all to work but we can't figure out how make a MultiLevelPartition using KaHIP and Buffoon, (Christian Schulz have provided KaHip with Buffoon extension) we have tried making a single level partition using both kaffpa and buffoon, but how do we make the mlp file from the metis graph file?
As for a we can read from the KaHIP documentation kaffpa makes the MultiLevelPartition and we can supply an existing partition (e.g. from Buffoon) to kaffpa, but how?

I hope you can help us. Best regards Samuel.

mlp file

Hi
how do you create mlp file for this project?

Thanks,
Raheleh

run on a map

Hi
I could make your code run on an osm map of Montreal.
I was wondering, how you use your code to run the query performance and time that a person needs to go from one point to another point in the given map?

Thanks,
Raheleh

Got 'std::bad_alloc' while running querytest

Hi Michael,
Really appreciate it for you great work on CRP. I am very interested in the route planning algorithm and I was trying to build and run this project following your guidance in the repo.
After I run the command "scons --target=QueryTest --optimize=Opt", I got an executable program "querytest" in the "deploy" folder, and then I run the "querytest" in the "deploy" folder with
"./querytest 2 ../examples/karlsruhe/karlsruhe.graph.bz2 ../examples/karlsruhe/karlsruhe.overlay ../examples/karlsruhe/metrics/time time" command.
However, while running, the used memory was increasing constantly and after a while, I got error with:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Aborted

It looks like Out Of Memory error, but the memory of my machine is 128G. I think it should be sufficient for loading the metric file (4.64G), could you please help me figure out what the problem with my program and how can I fix it?
Looking forward to your apply and thank you in advance.

Tony Tong

error in /deploy/precalculation

Hi

When I run the ./deploy/precalculation with the map from my own city, it gives me the following error:
terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::substr: __pos (which is 18446744073709551615) > this->size() (which is 26)
Aborted (core dumped)

Do you know what's the cause of this error and how can I fix it?

Thanks

build err! help

root@iZ28jl3eyxcZ:~/crp/CRP# scons --target=CRP --optimize=Opt -j1
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: building associated VariantDir targets: .buildOpt
g++ -o .buildOpt/io/GraphIO.o -c -std=c++11 -Wall -c -fmessage-length=0 -fPIC -fopenmp -O3 -DNDEBUG -I/usr/local/Cellar/boost/1.59.0/include io/GraphIO.cpp
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-4.8/README.Bugs for instructions.
scons: *** [.buildOpt/io/GraphIO.o] Error 4
scons: building terminated because of errors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.