feat(algo): add GDS_NODE2VEC (icebug/NetworKit node embeddings) - #47
Merged
Conversation
adsharma
reviewed
Aug 9, 2026
This was referenced Aug 11, 2026
Merged
zachwinter
force-pushed
the
feat/gds-node2vec
branch
from
August 13, 2026 01:22
592d71e to
970b072
Compare
Structural node embeddings from graph topology alone, via NetworKit's Node2Vec —
the graph-native "semantics" primitive: cosine-near embeddings are structurally
(and, for a citation graph, conceptually) related nodes.
Same bridge as GDS_PAGE_RANK (CSR -> NetworKit::GraphR -> algo -> results); the new
piece is a LIST(FLOAT) output column, emitted per node from Node2Vec's getFeatures()
via the ListVector addList pattern. Castable to ARRAY(FLOAT, d) for the vector
extension's HNSW index.
`CALL GDS_NODE2VEC('G') RETURN node, embedding` -> one 64-dim embedding per node.
Validated: on a star graph, the structurally-equivalent leaves have cosine ~0.997
between their embeddings vs ~0.92 to the hub.
MVP: fixed hyperparameters (P=1, Q=1, walk length 10, 5 walks, dim 64) and single
node-table graphs. Configurable params, ARRAY output, and a direct build-HNSW-index
variant are follow-ups. Stacks on the GDS_PAGE_RANK bridge (needs its icebug CMake).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
zachwinter
force-pushed
the
feat/gds-node2vec
branch
from
August 13, 2026 01:24
970b072 to
c0e8e43
Compare
Contributor
Author
|
Rebased onto main now that #54 is in: this PR is now a single commit — GDS_NODE2VEC consuming the shared |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second icebug-backed GDS function, following the pattern #30 established:
CALL GDS_NODE2VEC('G') RETURN node, embeddingruns NetworKit's Node2Vec over the projected graph and returns aLIST(FLOAT)embedding column (64 dimensions).The bridge half is identical to
gds_page_rank.cpp; the new plumbing is the output side — emitting a variable-length list per node throughListVector::addList+ the list data vector, rather than a scalar. It builds its CSR witharrow::system_memory_pool()from the start (the mimalloc-under-dlopen issue — see #46).Why this one next
Embeddings compose with the vector extension:
LIST(FLOAT)casts toARRAY(FLOAT, 64), which feedsCREATE_VECTOR_INDEX/ HNSW. That makesGDS_NODE2VEC → cosine / HNSWa graph-native similarity pipeline with no external embedding step.Testing
gds_node2vec.test: star graph, asserts every node gets a 64-dim embedding. Node2Vec is stochastic (unseeded), so the test asserts shape, not values.Validated the semantic property separately: on a star graph, structurally-equivalent leaves embed at cosine ~0.997 to each other vs ~0.92 to the hub (via
CAST(embedding AS FLOAT[64])+array_cosine_similarity).Notes / follow-ups
page_rank_config.his the natural follow-up once the GDS surface question (per-algo functions vs aGDS_FUNCTIONdispatcher) settles.Types of changes
Checklist
🤖 Generated with Claude Code