Skip to content

freemso/node2vec-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node2vec-java

This repository is an implementation of node2vec using Java.

The node2vec algorithm learns continuous representations for nodes in any (un)directed, (un)weighted graph. Please check the project page for more details.

node2vec: Scalable Feature Learning for Networks. A. Grover, J. Leskovec. ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD), 2016.

The original oficial Python implementation can be found in this repository.

Basic Usage

Example

To run node2vec on Zachary's karate club network, execute the following command from the project home directory:
java -jar node2vec.jar --input graph/karate.edgelist --output emb/karate.emd

Options

You can check out the other options available to use with node2vec using:
java -jar node2vec.jar --help

Input

The supported input format is an edgelist:

node1_id_int node2_id_int <weight_float, optional>

The graph is assumed to be undirected and unweighted by default. These options can be changed by setting the appropriate flags.

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

Library

Releases

No releases published

Packages

No packages published

Languages