GraphEmbedding: five graph embedding algorithms behind one three call API
Implementation and experiments of graph embedding algorithms.
At a glance
- What is it?
- GraphEmbedding is a small Python package that implements five published graph embedding algorithms and very little else: two datasets, no release history, and a documentation surface made of code snippets. Its value is that every model follows the same four step shape, so comparing them means reading five short examples rather than five different APIs.
- Who is it for?
- Use GraphEmbedding when you already hold a networkx graph and want node vectors from a named published algorithm without writing the walk sampler and the skip gram loop yourself, and when reading Chinese algorithm explainers is acceptable.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Activity is slowing. The repository last received commits 6 months ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- shenweichen/GraphEmbedding3,842 ★ · +1
| Repository | 2026-09-24 | 2026-11-15 |
|---|---|---|
| shenweichen/GraphEmbedding | 3.8k | 3.8k |
1 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
Three calls turn an edge list into vectors
The library states its design goal as graph in, embedding out, and the API matches that claim tightly. Every algorithm follows the same sequence: build a networkx graph, construct a model with the parameters that algorithm cares about, call train, then call get_embeddings. DeepWalk is the shortest expression of the contract.
G = nx.read_edgelist('../data/wiki/Wiki_edgelist.txt',create_using=nx.DiGraph(),nodetype=None,data=[('weight',int)])# Read graph
model = DeepWalk(G,walk_length=10,num_walks=80,workers=1)#init model
model.train(window_size=5,iter=3)# train model
embeddings = model.get_embeddings()# get embedding vectorsThe constructor takes walk_length 10, num_walks 80 and workers 1, and train takes window_size 5 and iter 3. Nothing else stands between a graph object and a dictionary of vectors, so a reader can learn the interface from one snippet and map the other four models onto it. What the design does not provide is any window into the middle: no documented way to inspect the generated walks, no way to change sampling after construction, and no documented save or load call for a trained model.
The distribution name is ge, not GraphEmbedding
Installing the project does not give you a package called GraphEmbedding. setup.py sets name to ge, version 0.1.0, and sets python_requires to 3.7 or newer, so on an older interpreter the install stops at the requirement check rather than at import time. The documented path is two lines:
pip install -e .[tf]
python examples/deepwalk_wiki.pyThe tf extra asks for tensorflow 1.15.5 or newer, and because that extra is attached to the documented command, a TensorFlow wheel is pulled into the environment even when the intent is to run one of the walk based examples. A second extra named test carries pytest 7, pytest-cov 4 and python-coveralls. Neither extra is described in prose anywhere; the only way to learn they exist is to read setup.py.
Input is one edge list line per edge, read through networkx
The only documented input format is a text file whose lines are node1 node2 <edge_weight>. Every example loads it with nx.read_edgelist using create_using=nx.DiGraph(), nodetype=None and data=[('weight',int)], so the graph is directed and every edge carries an integer weight. All but one example point at the same file through a relative path such as ../data/wiki/Wiki_edgelist.txt; the Struc2Vec snippet switches to ../data/flight/brazil-airports.edgelist. The repository ships a data directory and an examples directory holding seven scripts, one per algorithm and dataset pairing. Those relative paths climb one level, which means they assume a working directory below the repository root, and the README does not say which directory that is or describe the contents of data.
Constructor signatures diverge exactly where the algorithms do
Only the walk based models share a signature. LINE takes embedding_size 128 and order 'second', with a note that order can be 'first', 'second' or 'all', then trains with batch_size 1024, epochs 50 and verbose 2. SDNE takes hidden_size [256, 128], a layer pair rather than one width, and trains with batch_size 3000, epochs 40 and verbose 2. Node2Vec adds p 0.25 and q 4 on top of walk_length and num_walks, and those two parameters are what separate it from DeepWalk in this code. Struc2Vec is built positionally as Struc2Vec(G, 10, 80, workers=4, verbose=40), so its first two arguments mirror the walk length and walk count used elsewhere while the prose never names them.
Iteration budgets and progress reporting are not comparable
The training numbers in the snippets differ by more than an order of magnitude, and the README offers no guidance on choosing between them. DeepWalk and Node2Vec both train with iter 3 and window_size 5, LINE trains for 50 epochs at batch_size 1024, and SDNE trains for 40 epochs at batch_size 3000. Struc2Vec passes verbose 40 to its constructor, where the two neural models pass verbose 2 to train and the two walk based models pass no verbosity argument at all. get_embeddings is the single output path in all five snippets, and no shape, dtype, node ordering or key type is stated for its return value. Comparing the five models therefore means reading the snippets side by side; the documentation does not normalise the surface.
No releases, and a package version frozen at 0.1.0
The repository publishes no GitHub releases, so there is no changelog and nothing to pin. setup.py hardcodes version 0.1.0 and nothing in the tree increments it, and there are no version tags to fall back on. The last push to the default branch master is dated 2026-04-26, roughly five months before this reading, so the code is recent without being actively released. Licence is MIT in both setup.py and the repository LICENSE file. The top level is small: .gitattributes, .github/, .gitignore, LICENSE, README.md, data/, examples/, ge/, pics/, setup.py and tests/, with a CI workflow badge and a codecov badge at the top of the README. A tests directory and the test extra exist, but the README reports no results from either.
The algorithm explanations live in Chinese blog posts, not in the repo
The Method section of the README is a table pairing five papers with external explainers. DeepWalk is credited to KDD 2014, LINE to WWW 2015, Node2Vec and SDNE to KDD 2016, and Struc2Vec to KDD 2017, and each row links a paper PDF next to a Chinese write up on zhuanlan.zhihu.com with titles in the form 【Graph Embedding】DeepWalk: 算法原理,实现和应用. The reasoning behind each algorithm is thus documented outside the repository. Inside it, the written guidance amounts to the design sentence, the input format line and the five snippets. There is no parameter reference: default walk lengths, the ceiling on workers, and the node type produced by an edge list read with nodetype=None are never stated. The section titled DisscussionGroup, misspelled that way, points at a WeChat account and at the author's other repositories.
Two heavy dependencies are resolved together by one command
gensim is required at 4.0.0 or newer, while the tf extra asks for tensorflow 1.15.5 or newer, and the tf extra is part of the install command the README gives. Both are floors rather than upper bounds, so the documented install asks a package manager to place a TensorFlow build and a current gensim in the same interpreter. Neither is marked optional. The only interpreter constraint stated anywhere is the 3.7 floor in setup.py; no tested operating system, no tested TensorFlow version and no known good combination is recorded. Because there are no releases either, the environment that works for a given user is not written down anywhere, and the seven scripts under examples are the only available test.
Editorial conclusion
Use GraphEmbedding when you already hold a networkx graph and want node vectors from a named published algorithm without writing the walk sampler and the skip gram loop yourself, and when reading Chinese algorithm explainers is acceptable. Do not treat it as a pinned dependency, because the project publishes no releases and setup.py never leaves 0.1.0, and do not treat it as a documented interface, because walk lengths, window sizes and even the return type of get_embeddings are visible only inside the example snippets. Before committing, confirm that your TensorFlow and gensim installs resolve on the same Python version, since the single documented command requests both, and check node keying yourself, because edges are read with nodetype=None and no lookup mapping is described.
Frequently asked questions
What does GraphEmbedding install as, and what does it require?
It installs as the ge package at version 0.1.0 and needs Python 3.7 or newer. Its required dependencies are gensim 4.0.0 or newer, networkx, joblib, fastdtw, tqdm, numpy, scikit-learn, pandas and matplotlib.
Which graph embedding algorithms does GraphEmbedding implement?
Five, each with a runnable example under examples/: DeepWalk from KDD 2014, LINE from WWW 2015, Node2Vec from KDD 2016, SDNE from KDD 2016 and Struc2Vec from KDD 2017.
How does GraphEmbedding read its input graph?
Through networkx. Each line of the file is node1 node2 <edge_weight>, and the examples call nx.read_edgelist with create_using=nx.DiGraph(), nodetype=None and data=[('weight',int)] against a file inside the data directory.
Can I pin a version of GraphEmbedding?
Not from releases. The repository publishes no GitHub releases, setup.py stays at 0.1.0, and the last push to the master branch is dated 2026-04-26.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/shenweichen-graphembedding)Star history chart for your README
[](https://hysenlabs.com/projects/shenweichen-graphembedding)Was this useful?