liveBook · Manning

Euclidean space

As explained in Knowledge Graphs and LLMs in Action

Euclidean space is a geometric space in which points have coordinate representations and distances follow the standard straight-line metric.

Euclidean space represents points as coordinate vectors, measures distance with straight lines, and follows the Pythagorean theorem. It is the default geometric setting for many machine-learning models and embeddings. section 11.1.1

Key properties include:

  • Representing an item as coordinates such as (0.5, 0.3). section 11.1.1
  • Calculating distance as the square root of the sum of squared coordinate differences. section 11.1.1
  • Treating relationships as uniform, with space between points remaining constant regardless of position. section 11.1.1

Graph embeddings

An encoding function maps graph nodes into a multidimensional Euclidean embedding space. Training can arrange the vectors so that distances reflect relevant relationships in the original graph, although hierarchical structures may fit hyperbolic space better. section 11.1.1

Figure 11.2 Euclidean vs. non-Euclidean space [3]. Pixels in an image are all equally distant from each other and have eight neighbors (except those on the border). In a graph, the number of neighbors can vary enormously from one node to another.
figure

Compare Euclidean regularity with graph structure: image pixels have predictable neighborhoods, while graph nodes can have widely varying numbers of neighbors. section 11.1.1

How Knowledge Graphs and LLMs in Action covers it

How deep it goes
Defines coordinates, straight-line distance, and spatial growth, then contrasts Euclidean geometry with hyperbolic alternatives.
Examples
Uses coordinate vectors, image pixels, graph nodes, and multidimensional embedding spaces as concrete examples.
What you can do after
Evaluate/understand when straight-line geometry is suitable for embeddings and when hierarchical data may require another space.
How it connects
Connects graph embeddings, graph neural networks, non-Euclidean space, and hyperbolic space.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Knowledge Graphs and LLMs in Action. The section links point to the parts of the book it draws on.