1#ifndef SMOLLERGRAPH_EMBED_H_
2#define SMOLLERGRAPH_EMBED_H_
20std::vector<Embedding>
FastRP(
const Graph& graph, std::string_view type,
30 const std::vector<Embedding>& embeddings,
NodeId node,
size_t k);
std::array< float, kEmbeddingSize > Embedding
A node's embedding: a vector of numbers that stands for where the node is in the graph,...
float Cosine(const Embedding &a, const Embedding &b)
How alike two embeddings are: the cosine of the angle between them, 1 when they point the same way,...
std::vector< std::pair< NodeId, float > > MostSimilar(const std::vector< Embedding > &embeddings, NodeId node, size_t k)
Returns the k nodes whose embeddings are most like node's, with their cosines, the most alike first.
std::vector< Embedding > FastRP(const Graph &graph, std::string_view type, uint32_t seed)
Returns an embedding for each node, in the order of their ids, computed with FastRP,...