百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

struc2vec

> 编程语言
开源

此仓库提供了 struc2vec 的参考实现。

393 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

此仓库提供了 struc2vec 的参考实现。

struc2vec

This repository provides a reference implementation of struc2vec as described in the paper:

struc2vec: Learning Node Representations from Structural Identity.

Leonardo F. R. Ribeiro, Pedro H. P. Saverese, Daniel R. Figueiredo.

Knowledge Discovery and Data Mining, SigKDD, 2017.

The struc2vec algorithm learns continuous representations for nodes in any graph. struc2vec captures structural equivalence between nodes.

Before to execute struc2vec, it is necessary to install the following packages:

pip install futures

pip install fastdtw

pip install gensim

Update

Python 3 version: https://github.com/sebkaz/struc2vec/tree/master

Basic Usage

Example

To run struc2vec on Mirrored Zachary's karate club network, execute the following command from the project home directory:

``python src/main.py --input graph/karate-mirrored.edgelist --output emb/karate-mirrored.emb``

Options

To activate optimization 1, use the following option: --OPT1 true

To activate optimization 2: --OPT2 true

To activate optimization 3: --OPT3 true

To run struc2vec on Barbell network, using all optimizations, execute the following command from the project home directory:

python src/main.py --input graph/barbell.edgelist --output emb/barbell.emb --num-walks 20 --walk-length 80 --window-size 5 --dimensions 2 --OPT1 True --OPT2 True --OPT3 True --until-layer 6

You can check out the other options available to use with struc2vec using:

``python src/main.py --help``

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

Miscellaneous

Please send any questions you might have about the code and/or the algorithm to .

Note: This is only a reference implementation of the framework struc2vec.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythonalgorithmgraph

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言