GithubHelp home page GithubHelp logo

neveroldmilk / shortest-distance-approx-deep-learning Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nayash/shortest-distance-approx-deep-learning

0.0 0.0 0.0 118.57 MB

Implementation of the paper "Shortest Path Distance Approximation using Deep learning Techniques" (under development)

License: Apache License 2.0

Python 1.09% Jupyter Notebook 98.91%

shortest-distance-approx-deep-learning's Introduction

shortest-distance-approx-deep-learning

Implementation of the paper "Shortest Path Distance Approximation using Deep learning Techniques"

Problem Statement

Using traditional methods(Dijkstra's Algo etc) for solving graph problems like shortest path distance is not scalable for very large graphs we see these days like social media graphs. This paper suggests a method to approximate shortest path distances using Deep Learning.

Proposed Solution

  1. Get your graph data.
  2. Use algorithm suggested in Node2Vec paper to find feature vector embeddings for your graph. I have used the implementation of Node2Vec algo provided by original authors of the paper.
  3. Prepare your training/test dataset: a. Use Node2Vec to find feature embeddings for each of your graph nodes. b. Select a small number of landmark nodes (l) from all the nodes (n) of the graph, where l << n. c. For each landmark node (l1), find shortest distance between l1 and rest of the nodes of graph. This way you have l*(n-1) edge-distance pairs. d. For each edge (pair of nodes) in your training data, combine the corresponding feature vectors of the nodes using any of suggested binary operations (avergage, concatenation etc).
  4. Now you have feature embedding for each edge in your dataset and a corresponding distance. Train the neural net!

Results

Note: Even though the problem is formulated as a regression problem, I have used accuracy (a classification metric) to make the improvements in model performance more intuitive.

Baseline: Accuracy=50.57%, MSE=0.56, MAE=0.59 Best MLP (till now): Accuracy=76%, MSE=0.18, MAE=0.34

Files in the project

Main project files are data_prep.ipynb and train.ipynb. I have also included a "fun.ipynb" file which has some interesting observations from the project. Node2Vec implementation provided by authors was in python2, so I have converted and included the necessary files in python3 format. This time I have also included all the experiments and results that I captured in the tensorboard.

Graph data is downloaded with gratitude from:

@inproceedings{nr,
      title = {The Network Data Repository with Interactive Graph Analytics and 
      Visualization},
      author={Ryan A. Rossi and Nesreen K. Ahmed},
      booktitle = {AAAI},
      url={http://networkrepository.com},
      year={2015}
  }

shortest-distance-approx-deep-learning's People

Contributors

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