Giter Site home page Giter Site logo

sinpat / multi-ch-constructor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lesstat/multi-ch-constructor

0.0 1.0 0.0 202 KB

Creates contraction hierarchy graphs for multi metric graphs

License: GNU General Public License v3.0

CMake 65.73% Shell 0.18% C++ 34.09%

multi-ch-constructor's Introduction

Multi-CH-Constructor

A multi-threaded multi-criteria contraction hierarchy graph creator. The general approach follows this paper. But a few improvements have been made to ensure that less shortcuts are generated. Less shortcuts lead to faster contraction time and higher speed-up of Dijkstra runs.

Build

To Build Multi-CH-Constructor first clone it and change into its directory:

git clone --recursive https://github.com/lesstat/multi-ch-constructor
cd multi-ch-constructor

Then create a build directory for cmake and run cmake and make.

cmake -Bbuild
cmake --build build

Usage

The main executable of Multi-CH-Constructor is multi-ch. It has the following CLI options:

$ ./build/multi-ch -h
  -h [ --help ]               Prints help message

loading options:
  -t [ --text ] arg           Load graph from text file
  -m [ --multi ] arg          Load graph from multiple files

contraction options:
  -p [ --percent ] arg (=98)  How far the graph should be contracted
  --stats                     Print statistics while contracting
  --threads arg               Maximal number of threads used

saving:
  -w [ --write ] arg          File to save graph to

It needs exactly one parameter of the loading category to load a graph. The text format is described in detail here. The Dimension of the graph must match the DIMENSION constant in the graph.hpp file. The application must be recompiled to contract graphs of other dimensions.

The -p option specifies how much of the graph will be contracted. This option can and should be given as decimal value aka -p 99.85.

The --stats options prints per thread per round information of the contraction.

With the --threads option the number of threads is specified. If left out the number of threads is determined by std::thread::hardware_concurrency()

-w specifies where to save the graph. The format is the same as the text format.

Shortcut Reducing Improvements

  • Duplicate shortcuts (source target and cost vector) are delete after every contraction round.

  • Augmented LP:

    The original paper proposes the following LP for finding a configuration the certifies the need for a shortcut. When checking path p~, for all paths p found form s to t which are not p~ introduce a constraint:

    alpha^T * (c(p) - c(p~)) <= 0
    

    This does not work when alpha^T * c(p) == alpha^T * c(p~). Therefore the following LP is used

    max delta
    alpha^T * (c(p) - c(p~)) + delta  <= 0
    
  • More than one path with minimal cost:

    When delta = 0 after the LP runs and more than one path has the same cost as the shortcut a heuristic search is done to find if one of the paths has no node that is contracted in this route inside. If one such path is found, it certifies that no shortcut is needed.

multi-ch-constructor's People

Contributors

lesstat avatar

Watchers

James Cloos avatar

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.