GithubHelp home page GithubHelp logo

dreambydream / pruned-landmark-labeling Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iwiwi/pruned-landmark-labeling

0.0 1.0 0.0 175 KB

Fast and exact shortest-path distance querying index

Home Page: http://www-imai.is.s.u-tokyo.ac.jp/~takiba/index_e.html

C 84.98% C++ 15.02%

pruned-landmark-labeling's Introduction

Pruned Landmark Labeling

Pruned landmark labeling is a new shortest-path distance querying algorithm for real-world graphs, such as social networks, web graphs, biological networks and computer networks.

Advantages

The algorithm has the following advantages (for details, please see our paper):

  • Fast --- it answers distance queries in microseconds,
  • Scalable --- it can be applied to networks with hundreds of millions of edges,
  • Exact --- unlike approximate methods, it always answers exactly correct distance, and
  • Almost Parameter Free --- unlike other state-of-the-art methods, it does not require any parameter tuning.

Moreover, this implementation is:

  • Easy to Use --- by copying only one header file to your project, you can start using the index.

Usage

Given a graph, it first constructs an index. Then, using the index, it can quickly answer distance between two vertices.

From CUI Interface

$ make
$ bin/construct_index samples/graph_example.tsv index_file
$ bin/query_distance index_file <<< "1 4"
2
  • Execute make to build programs.
  • Execute bin/construct_index to construct an index from a graph.
  • Execute bin/query_distance and write pairs of vertices to STDIN to query distance between pairs of vertices.

From Your Program

PrunedLandmarkLabeling<> pll;
pll.ConstructIndex(edge_list);
cout << pll.QueryDistance(1, 4) << endl;
  • Call ConstructIndex to construct an index from a graph (an edge list or a file).
  • Call QueryDistance to query distance between two vertices.
  • Call LoadIndex and StoreIndex to load and store an index.

For further information, please see pruned_landmark_labeling.h, samples and tests.

Details

  • In a graph file, each line should contain two integers describing an edge (see samples/graph_example.tsv).
  • Vertices should be described by integers starting from zero.
  • Program bin/query_distance reads pairs of vertices until EOF, thus you can use it to process multiple pairs of vertices at once.
  • Execute make test to run tests (google-gtest is required).

References

pruned-landmark-labeling's People

Contributors

iwiwi avatar

Watchers

 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.