Code Monkey home page Code Monkey logo

pagerank's Introduction

PageRank in timely dataflow

This repository contains an implementation of the PageRank algorithm in timely dataflow, implemented in Rust. By default, it runs 20 PageRank iterations and then prints some statistics.

To run, clone the repo, prepare the inputs and run. We assume that you have a working Rust installation, and that your input graph is in text-based edge list format.

Preparing the inputs

The input format for our PageRank implementation is a binary-packed adjacency list for a graph. You can use the parse binary to transform an ASCII/UTF-8 edge list into this format:

$ cargo run --release --bin parse -- my-graph < my-edgelist.txt

This will generate binary files my-graph.offsets and my-graph.targets, which can be the used as inputs to the pagerank binary.

parse assumes that the inputs are in tab-seperated text, but you can change to a different delimiter by editing src/bin/parse.rs. For a small example data set that works out of the box, use the LiveJournal graph. A single-threaded iteration on this graph takes about 0.67s on a 2013 MacBook Air.

Our blog posts have links to the larger twitter_rv and uk_2007_05 data sets.

Running PageRank

To run on inputs my-graph.offsets and my-graph.targets, run:

$ cargo run --release --bin pagerank -- my-graph worker [options]

The worker argument indicates you would like worker-level aggregation. You can alternately use process for process-level aggregation.

Without any options, the code runs single-threadedly. The -w option can be used to set the number of threads to use; -h,-n and -p can be used to run distributedly:

$ cat hosts.txt
hostname0:port
hostname1:port
hostname2:port
hostname3:port

hostname0$ cargo run --release --bin pagerank -- my-graph -h hosts.txt -n 4 -p 0
hostname1$ cargo run --release --bin pagerank -- my-graph -h hosts.txt -n 4 -p 1
hostname2$ cargo run --release --bin pagerank -- my-graph -h hosts.txt -n 4 -p 2
hostname3$ cargo run --release --bin pagerank -- my-graph -h hosts.txt -n 4 -p 3

The inputs must already be present in the working directory on all hosts.

Context

We have written blog posts about the development of this implementation; there, we also compare it against the widely used GraphX system for Apache Spark.

To learn more about timely dataflow in Rust, you might be interested in the following blog posts, too:

pagerank's People

Contributors

frankmcsherry avatar ms705 avatar scooter-dangle 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.