GithubHelp home page GithubHelp logo

pagerank's Introduction

An Open Source PageRank Implementation

This project provides an open source PageRank implementation. The implementation is a straightforward application of the algorithm description given in the American Mathematical Society's Feature Column How Google Finds Your Needle in the Web's Haystack, by David Austing. It can handle very big hyperlink graphs with millions of vertices and arcs.

Building

The project is written in standard C++ and can be built by running:

g++ -o pagerank pagerank.cpp table.cpp table.h

Usage

pagerank is invoked by

pagerank [OPTIONS] graph_file

where OPTIONS may be:

  • -t: if set, tracing is enabled. Tracing outputs all intermediate steps of the pagerank calculation algorithm and can be very voluminous.

  • -n: if set, the graph_file is in numeric format, that is it consists of lines of the form where and are integer vertex indices, starting with zero. If not set, the graph_file consists of lines of the form where and and vertex IDs, and will be interpreted as strings.

  • -a : the pagerank dumping factor; default is 0.85.

  • -c : the convergence criterion. The pagerank iterations will stop when two successive iterations have converged to less than or equal to this value. Default is 0.00001.

  • -s : the number of rows of the hyperlink matrix. This is not the maximum size; if the graph requires more rows, they will be allocated as necessary. If an approximate size is known beforehand, however, the necessary internal data structures can be pre-allocated for better performance.

  • -d : the delimited used to separate vector indices in the input graph file. Default is " => ".

Testing

Testing the implementation was carried out by comparing with pagerank calculations produced by Jung. The Java code that produced the calculations can be found in the java directory of the project. The test suites can be found at the test directory of the project, along with the test driver program pagerank_test.cpp, which is invoked by:

 pagerank_test <test_suite> 

The <test_suite> is a file containing in each line a filename, in the same directory, with an input graph. For an input graph foo.txt, the pagerank results against which we want to compare our implementation is found in foo-pr.txt. The result files are generated by the pagerank_calc.sh script.

The test driver is written in standard C++ and can be compiled with:

g++ -I../cpp -o pagerank_test pagerank_test.cpp ../cpp/table.cpp 

The graph test files were generated by the igraph R port using the R scripts in the test directory.

pagerank's People

Contributors

gousiosg avatar louridas avatar niangaotuantuan 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.