Giter Site home page Giter Site logo

maxuewei2 / riwalk Goto Github PK

View Code? Open in Web Editor NEW
13.0 4.0 4.0 2.7 MB

Code for the ICDM 2019 Paper "RiWalk: Fast Structural Node Embedding via Role Identification".

License: MIT License

Python 60.26% C 37.97% Shell 1.77%
network-embedding graph-embedding graph-algorithms graph-representation-learning network-representation-learning structural-embedding graph icdm struc2vec representation-learning

riwalk's Introduction

RiWalk

This repository provides reference implementations of RiWalk as described in the paper:

RiWalk: Fast Structural Node Embedding via Role Identification.
Xuewei Ma, Geng Qin, Zhiyang Qiu, Mingxin Zheng, Zhe Wang.
IEEE International Conference on Data Mining, ICDM, 2019.

The RiWalk algorithm learns continuous representations for nodes in graphs. The learned representations capture structural similarities between nodes.




RiWalk decouples the structural embedding problem into a role identification procedure and a network embedding procedure.
The key idea of RiWalk can be illustrated as in the following picture.

Two nodes a and u residing far apart in a network have similar local topologies but totally different context nodes. However, after the role identification procedure, they have similar context and are indirectly densely connected, thus typical network embedding methods can be directly applied to learn structural embeddings.

Usage

This repository provides several different implementations of RiWalk:

  • src/RiWalk: a python implementation of RiWalk-SP and RiWalk-WL as described in the paper.
  • src/RiWalk-RW: a python implementation of RiWalk-RW-SP and RiWalk-RW-WL, two variations of RiWalk-SP and RiWalk-WL. RiWalk-RW traverses a subgraph induced by random walk sequences instead of breadth-first searching the local subgraph.
  • src/RiWalk-C: a C implementation of RiWalk-SP and RiWalk-RW-SP.

Full Command List

The full list of command line options is available with

# RiWalk
python3 src/RiWalk/RiWalk.py --help  
# RiWalk-RW
python3 src/RiWalk-RW/RiWalk-RW.py --help  
# RiWalk-C
gcc -lm -pthread -Ofast -march=native -Wall -ffast-math -Wno-unused-result src/RiWalk-C/RiWalk.c -o src/RiWalk-C/RiWalk
src/RiWalk-C/RiWalk  

Example

We provide an example running script for the actor data set in train_actor.sh.

Input

The supported input format is an edgelist:

node1_id_int node2_id_int

Output

The output file has n+1 lines for a graph with n vertices. The first line has the following format:

num_of_nodes dim_of_representation

The next n lines are as follows:

node_id dim1 dim2 ... dimd

where dim1, ... , dimd is the d-dimensional representation learned by RiWalk.

Running Time Comparison

Acknowledgements

We would like to thank the authors of node2vec, struc2vec, GraphWave and LINE for the open access of the implementations of their methods.

Miscellaneous

  • Please send any questions you might have about the code and/or the algorithm to [email protected].

Citation

https://dblp.org/rec/bibtex/conf/icdm/MaQQZW19

riwalk's People

Contributors

maxuewei2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

riwalk's Issues

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.