{"id":13678443,"url":"https://github.com/leoribeiro/struc2vec","last_synced_at":"2025-04-29T13:30:57.737Z","repository":{"id":48191129,"uuid":"79132370","full_name":"leoribeiro/struc2vec","owner":"leoribeiro","description":"This repository provides a reference implementation of struc2vec.","archived":false,"fork":false,"pushed_at":"2023-07-09T17:46:21.000Z","size":19769,"stargazers_count":382,"open_issues_count":11,"forks_count":116,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-11-11T20:35:21.007Z","etag":null,"topics":["algorithm","graph"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leoribeiro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-01-16T15:35:54.000Z","updated_at":"2024-11-01T13:23:40.000Z","dependencies_parsed_at":"2022-09-21T00:50:54.303Z","dependency_job_id":"788bbae2-f2f7-40d3-b6ee-454426738ac8","html_url":"https://github.com/leoribeiro/struc2vec","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoribeiro%2Fstruc2vec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoribeiro%2Fstruc2vec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoribeiro%2Fstruc2vec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leoribeiro%2Fstruc2vec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leoribeiro","download_url":"https://codeload.github.com/leoribeiro/struc2vec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251509435,"owners_count":21600637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","graph"],"created_at":"2024-08-02T13:00:53.666Z","updated_at":"2025-04-29T13:30:57.426Z","avatar_url":"https://github.com/leoribeiro.png","language":"Python","funding_links":[],"categories":["Python","图嵌入、网络表征学习","Uncategorized"],"sub_categories":["网络服务_其他","Uncategorized"],"readme":"# struc2vec\n\nThis repository provides a reference implementation of *struc2vec* as described in the paper:\u003cbr\u003e\n\u003e struc2vec: Learning Node Representations from Structural Identity.\u003cbr\u003e\n\u003e Leonardo F. R. Ribeiro, Pedro H. P. Saverese, Daniel R. Figueiredo.\u003cbr\u003e\n\u003e Knowledge Discovery and Data Mining, SigKDD, 2017.\u003cbr\u003e\n\nThe *struc2vec* algorithm learns continuous representations for nodes in any graph. *struc2vec* captures structural equivalence between nodes.  \n\nBefore to execute *struc2vec*, it is necessary to install the following packages:\n\u003cbr/\u003e\n``pip install futures``\n\u003cbr/\u003e\n``pip install fastdtw``\n\u003cbr/\u003e\n``pip install gensim``\n\n### Update\nPython 3 version: https://github.com/sebkaz/struc2vec/tree/master\n\n### Basic Usage\n\n#### Example\nTo run *struc2vec* on Mirrored Zachary's karate club network, execute the following command from the project home directory:\u003cbr/\u003e\n\t``python src/main.py --input graph/karate-mirrored.edgelist --output emb/karate-mirrored.emb``\n\n#### Options\n\nTo activate optimization 1, use the following option:\n``--OPT1 true``\n\u003cbr/\u003e\nTo activate optimization 2:\n``--OPT2 true``\n\u003cbr/\u003e\nTo activate optimization 3:\n``--OPT3 true``\n\u003cbr/\u003e\n\nTo run *struc2vec* on Barbell network, using all optimizations, execute the following command from the project home directory:\n\u003cbr/\u003e\n``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``\n\n\nYou can check out the other options available to use with *struc2vec* using:\u003cbr/\u003e\n\t``python src/main.py --help``\n\n#### Input\nThe supported input format is an edgelist:\n\n\tnode1_id_int node2_id_int\n\t\t\n\n#### Output\nThe output file has *n+1* lines for a graph with *n* vertices. \nThe first line has the following format:\n\n\tnum_of_nodes dim_of_representation\n\nThe next *n* lines are as follows:\n\t\n\tnode_id dim1 dim2 ... dimd\n\nwhere dim1, ... , dimd is the *d*-dimensional representation learned by *struc2vec*.\n\n\n### Miscellaneous\n\nPlease send any questions you might have about the code and/or the algorithm to \u003cleonardofribeiro@gmail.com\u003e.\n\n*Note:* This is only a reference implementation of the framework *struc2vec*.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleoribeiro%2Fstruc2vec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleoribeiro%2Fstruc2vec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleoribeiro%2Fstruc2vec/lists"}