{"id":13678283,"url":"https://github.com/maxuewei2/RiWalk","last_synced_at":"2025-04-29T12:34:45.516Z","repository":{"id":163400458,"uuid":"202550238","full_name":"maxuewei2/RiWalk","owner":"maxuewei2","description":"Code for the ICDM 2019 Paper \"RiWalk: Fast Structural Node Embedding via Role Identification\".","archived":false,"fork":false,"pushed_at":"2020-04-27T10:07:34.000Z","size":2762,"stargazers_count":13,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-02T13:21:43.629Z","etag":null,"topics":["graph","graph-algorithms","graph-embedding","graph-representation","graph-representation-learning","icdm","network-embedding","network-representation-learning","representation-learning","struc2vec","structural-embedding"],"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/maxuewei2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-08-15T13:53:42.000Z","updated_at":"2023-04-03T08:37:24.000Z","dependencies_parsed_at":"2024-01-14T15:21:49.192Z","dependency_job_id":"98fe7355-6341-4ef0-954d-4dd9838f082b","html_url":"https://github.com/maxuewei2/RiWalk","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/maxuewei2%2FRiWalk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxuewei2%2FRiWalk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxuewei2%2FRiWalk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maxuewei2%2FRiWalk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maxuewei2","download_url":"https://codeload.github.com/maxuewei2/RiWalk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224173715,"owners_count":17268163,"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":["graph","graph-algorithms","graph-embedding","graph-representation","graph-representation-learning","icdm","network-embedding","network-representation-learning","representation-learning","struc2vec","structural-embedding"],"created_at":"2024-08-02T13:00:51.927Z","updated_at":"2024-11-11T20:31:18.069Z","avatar_url":"https://github.com/maxuewei2.png","language":"Python","readme":"# RiWalk\n\n\nThis repository provides reference implementations of **RiWalk** as described in the paper:\u003cbr\u003e\n\u003e RiWalk: Fast Structural Node Embedding via Role Identification.\u003cbr\u003e\n\u003e Xuewei Ma, Geng Qin, Zhiyang Qiu, Mingxin Zheng, Zhe Wang.\u003cbr\u003e\n\u003e IEEE International Conference on Data Mining, ICDM, 2019.\u003cbr\u003e\n\nThe RiWalk algorithm learns continuous representations for nodes in graphs. The learned representations capture structural similarities between nodes.  \n\n\u003cp align=\"center\"\u003e\n\u003cimg style=\"float: center;\" src=\"figures/structural-embedding.png\" width=\"720\"\u003e\n\u003c/p\u003e\n\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n---\n\nRiWalk decouples the structural embedding problem into a role identification procedure and a network embedding procedure. \u003cbr/\u003e\nThe key idea of RiWalk can be illustrated as in the following picture. \n\u003cp align=\"center\"\u003e\n\u003cimg style=\"float: center\" src=\"figures/key-idea.png\" width=\"720\"\u003e\n\u003c/p\u003e\n\nTwo 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.\n\n### Usage\nThis repository provides several different implementations of RiWalk:\n- src/RiWalk: a python implementation of RiWalk-SP and RiWalk-WL as described in the paper.\n- 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.\n- src/RiWalk-C: a C implementation of RiWalk-SP and RiWalk-RW-SP. \n\n#### Full Command List\nThe full list of command line options is available with \n```\tbash\n# RiWalk\npython3 src/RiWalk/RiWalk.py --help  \n# RiWalk-RW\npython3 src/RiWalk-RW/RiWalk-RW.py --help  \n# RiWalk-C\ngcc -lm -pthread -Ofast -march=native -Wall -ffast-math -Wno-unused-result src/RiWalk-C/RiWalk.c -o src/RiWalk-C/RiWalk\nsrc/RiWalk-C/RiWalk  \n```\n\n#### Example\nWe provide an example running script for the actor data set in [train_actor.sh](train_actor.sh).\n\n#### Input\nThe supported input format is an edgelist:\n```text\nnode1_id_int node2_id_int\n```\n\n#### Output\nThe output file has *n+1* lines for a graph with *n* vertices. \nThe first line has the following format:\n```text\nnum_of_nodes dim_of_representation\n```\nThe next *n* lines are as follows:\n```text\t\nnode_id dim1 dim2 ... dimd\n```\nwhere dim1, ... , dimd is the *d*-dimensional representation learned by RiWalk.\n\n### Running Time Comparison\n\n\u003cp align=\"center\"\u003e\n\u003cimg style=\"float: center\" src=\"figures/network_info.png\" width=\"720\"\u003e\n\u003c/p\u003e\n\n\u003cdiv style=\"width:100%;text-align:center\"\u003e\n\u003cimg style=\"display:inline-block\" src=\"figures/role-identification-time.png\" width=\"47%\"\u003e\n\u003cimg style=\"display:inline-block\" src=\"figures/walk-time.png\" width=\"47%\"\u003e\n\u003c/div\u003e\n\n### Acknowledgements\nWe would like to thank the authors of [node2vec](https://github.com/aditya-grover/node2vec), [struc2vec](https://github.com/leoribeiro/struc2vec), [GraphWave](https://github.com/snap-stanford/graphwave) and [LINE](https://github.com/tangjianpku/LINE) for the open access of the implementations of their methods.\n\n### Miscellaneous\n- Please send any questions you might have about the code and/or the algorithm to \u003cxuew.ma@gmail.com\u003e.\n\n###  Citation\n[https://dblp.org/rec/bibtex/conf/icdm/MaQQZW19](https://dblp.org/rec/bibtex/conf/icdm/MaQQZW19)\n\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxuewei2%2FRiWalk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaxuewei2%2FRiWalk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaxuewei2%2FRiWalk/lists"}