# What are graph embedding?

I recently came across graph embedding such as DeepWalk and LINE. However, I still do not have a clear idea as what is meant by graph embeddings and when to use it (applications)? Any suggestions are welcome!

• A graph embedding is an embedding for graphs! So it takes a graph and returns embeddings for the graph, edges, or vertices. Embeddings enable similarity search and generally facilitate machine learning by providing representations.
– Emre
Oct 25, 2017 at 23:31
• @Emre what does it meant by embedding? :) Oct 26, 2017 at 0:29
• As meaning of the embed goes, fixing things onto something. Graph embedding is kind of like fixing vertices onto a surface and drawing edges to represent say a network. So example be like planar graph can be embedded on to a $2D$ surface without edge crossing. Weights can be assigned to edges and appropriate edge lengths viz. helps us to understand/estimate as @Emre mentioned similarity search etc. Oct 26, 2017 at 0:58
• @KiriteeGak Thanks :) What are their real world applications? They say they can be used for recommendation and all? but how? Oct 26, 2017 at 1:25
• Youtube video recommendation can be visualised as a model where video you are currently watching is the node you are on and the next videos that is in your recommendation are the ones that are most similar to you based on the what similar users have watched next and many more factors of course which is a huge network to traverse.This paper is a simple good read on understanding the application. Oct 26, 2017 at 1:34

Graph embedding learns a mapping from a network to a vector space, while preserving relevant network properties.

Vector spaces are more amenable to data science than graphs. Graphs contain edges and nodes, those network relationships can only use a specific subset of mathematics, statistics, and machine learning. Vector spaces have a richer toolset from those domains. Additionally, vector operations are often simpler and faster than the equivalent graph operations.

One example is finding nearest neighbors. You can perform "hops" from node to another node in a graph. In many real-world graphs after a couple of hops, there is little meaningful information (e.g., recommendations from friends of friends of friends). However, in vector spaces, you can use distance metrics to get quantitative results (e.g., Euclidian distance or Cosine Similarity). If you have quantitative distance metrics in a meaningful vector space, finding nearest neighbors is straightforward.

"Graph Embedding Techniques, Applications, and Performance: A Survey" is an overview article that goes into greater detail.

What are graph Embeddings ? "Graph Embeddings" is a hot area today in machine learning. It basically means finding "latent vector representation" of graphs which captures the topology (in very basic sense) of the graph. We can make this "vector representation" rich by also considering the vertex-vertex relationships, edge-information etc. There are roughly two levels of embeddings in the graph (of-course we can anytime define more levels by logically dividing the whole graph into subgraphs of various sizes):

• Vertex Embeddings - Here you find latent vector representation of every vertex in the given graph. You can then compare the different vertices by plotting these vectors in the space and interestingly "similar" vertices are plotted closer to each other than the ones which are dissimilar or less related. This is the same work that is done in "DeepWalk" by Perozzi.
• Graph Embeddings - Here you find the latent vector representation of the whole graph itself. For example, you have a group of chemical compounds for which you want to check which compounds are similar to each other, how many type of compounds are there in the group (clusters) etc. You can use these vectors and plot them in space and find all the above information. This is the work that is done in "Deep Graph Kernels" by Yanardag.

Applications - By looking carefully, embeddings are "latent" representations which means if a graph has a |V| * |V| adjacency matrix where |V| = 1M, its hard to use or process a 1M * 1M numbers in an algorithm. So, latent embedding of dimension 'd', where d << |V|, would make the adjacency matrix |V| * d and relatively easier to use. Another application could be - Consider a simple scenario where we want to recommend products to the people who have similar interests in a social network. By getting vertex embeddings (here it means vector representation of each person), we can find the similar ones by plotting these vectors and this makes recommendation easy. These are some applications and there are others. You can refer to a nice survey paper - Graph Embedding Techniques, a Survey.

Where from it all came ? There has been a lot of works in this area and almost all comes from the groundbreaking research in natural language processing field - "Word2Vec" by Mikolov. If you want to get started with the research on graph embeddings, I would recommend to first understand how Word2Vec works. You can find nice explanations - Word2Vec parameter learning explained and Stanford Lecture. Then you can jump to the papers that you listed. Those works can be categorized as:

• Wowww!! This is absolutely a perfect answer. Thanks a lot :) Very well done :) Oct 27, 2017 at 7:34
• Hi Mausam Jain. Can you please let me know if I can use graph embeddings to identify important nodes in the network? Dec 25, 2017 at 17:42
• Hi, Volka. To answer this question, I need to know what type of graph are you working on; is it twitter, facebook, reddit or something else ? Dec 26, 2017 at 1:12
• Thank you for your reply. I am actually working in a social network where I want to identify the most social people :) Dec 26, 2017 at 4:26
• Here's a more elaborate version of this answer. towardsdatascience.com/… Jan 8, 2021 at 2:50

In the paper A central limit theorem for an omnibus embedding of random dot product graphs by Levin et.al. paper, a specific type of graph embedding (the Omnibus embedding) defines graph embedding as a methodology "in which the vertices of a graph are mapped to vectors in a low-dimensional Euclidean space." Check the link for more information.

• welcome to the forum. If you want to mention a paper, please write down its name as part of the text as well (because links can be broken). Dec 29, 2018 at 8:05
{"ft_lang_label":"__label__en","ft_lang_prob":0.924564,"math_prob":0.8126986,"size":6852,"snap":"2022-05-2022-21","text_gpt3_token_len":1549,"char_repetition_ratio":0.13273948,"word_repetition_ratio":0.010657194,"special_character_ratio":0.2278167,"punctuation_ratio":0.11304348,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.96942806,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-05-19T18:13:45Z\",\"WARC-Record-ID\":\"<urn:uuid:980ec262-9b0b-4f7d-8c7c-9309bd7011d2>\",\"Content-Length\":\"263375\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:02671a9a-0072-44f9-b7e0-d944beee80b1>\",\"WARC-Concurrent-To\":\"<urn:uuid:c1c5a988-6d81-4c22-84cd-7cf10df07259>\",\"WARC-IP-Address\":\"151.101.65.69\",\"WARC-Target-URI\":\"https://datascience.stackexchange.com/questions/24081/what-are-graph-embedding?noredirect=1\",\"WARC-Payload-Digest\":\"sha1:NYNEAYGBLXAGI3CYJNSEJMXHG3DH5RZV\",\"WARC-Block-Digest\":\"sha1:NSSXICF4VHYNEN2UW5AU4AUMMEIK6CES\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-21/CC-MAIN-2022-21_segments_1652662529658.48_warc_CC-MAIN-20220519172853-20220519202853-00123.warc.gz\"}"}