Git Product home page Git Product logo

bidirectional-random-walk's Introduction

Bidirectional Random Walk

This repository contains a bidirectional random walk (Personalized PageRank) estimation algorithm for large graphs. This algorithm is described in the paperPersonalized PageRank Estimation and Search: A Bidirectional Approach and more fully in Peter's PhD thesis.

As an example, we'll compute PPR scores between nodes 1 and 2 using teleport probability 0.2 on the small graph in /src/test/resources/test_graph.txt. First install java, sbt, and git. Then simply run

git clone https://github.com/plofgren/bidirectional-random-walk.git
cd bidirectional-random-walk
sbt console
val graph = co.teapot.graph.ConcurrentHashMapDynamicGraph.readGraph("src/test/resources/test_graph
.txt")
val estimator = new soal.ppr.BidirectionalPPREstimator(graph, teleportProbability=0.2f)
estimator.estimatePPRSingleSource(0, 1)
estimator.estimatePPRSingleSource(0, 1, relativeError=0.01f) // For greater accuracy

Our algorithm can also start from a distribution over source nodes rather than a single node. For example, if we want to estimate PPR scores using random walks that start at node 0 with probability 0.8 and node 2 with probability 0.2, we can run

val sourceDistribution = new soal.util.DiscreteAliasSampler(Seq(0, 2), Seq(0.8f, 0.2f))
estimator.estimatePPR(sourceDistribution, 1)

To support large graphs, this library uses the Tempest Graph Library which provides an efficient graph implementation based on memory mapped files.

bidirectional-random-walk's People

Contributors

plofgren 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.