ArticleslgStudy

mathematics

Distance (graph theory)

Distance (graph theory) is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Distance (graph theory) rather than just read about it. In short: In the mathematical field of graph theory, the distance between two vertices in a graph is the number of edges in a shortest path (also called a graph geodesic) connecting them. This is also known as the geodesic distance or shortest-path distance.

Distance (graph theory) — main illustration
Distance (graph theory) — illustration

Key takeaways

  • Distance (graph theory) belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Distance (graph theory) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Distance (graph theory) from memory before moving on to harder problems.

Reference excerpt

In the mathematical field of graph theory, the distance between two vertices in a graph is the number of edges in a shortest path (also called a graph geodesic) connecting them. This is also known as the geodesic distance or shortest-path distance. Notice that there may be more than one shortest path between two vertices. If there is no path connecting the two vertices, i.e., if they belong to different connected components, then conventionally the distance is defined as infinite. In the case of a directed graph the distance d(u,v) between two vertices u and v is defined as the length of a shortest directed path from u to v consisting of arcs, provided at least one such path exists. Notice that, in contrast with the case of undirected graphs, d(u,v) does not necessarily coincide with d(v,u)—so it is just a quasi-metric, and it might be the case that one is defined while the other is not.

Computational Representation In graph theory, distances between nodes can be represented computationally by using a distance matrix (also called the all-pairs shortest-path matrix). This is the square matrix ( D = ( d i j ) ) {\displaystyle (D=(d_{ij}))} , where each entry ( d i j ) {\displaystyle (d_{ij})} indicates the length of a shortest path between the two vertices ( v i ) {\displaystyle (v_{i})} and ( v j ) {\displaystyle (v_{j})} .

Distance matrices have several applications, which include telecommunications and chemistry. In chemical graph theory, multiple topological indices that characterize molecular structure were able to be derived from the distance matrix. Beyond exact matrix representations, graph distances can also be represented using metric embeddings. This approach maps the vertices of a graph to points in a geometric space (such as Euclidean space) in a way that preserves the graph distances as closely as possible.

Directed Graph Distance In a directed graph, edges have an assigned direction, meaning travel between vertices is not necessarily bidirectional. As a result, the distance from u {\textstyle u} to v {\displaystyle v} may differ from the distance from v {\displaystyle v} to u {\displaystyle u} . This makes directed graph distance a quasi-metric rather than a true metric. Formally, for vertices u {\displaystyle u} and v {\displaystyle v} in a directed graph G {\displaystyle G} , it is not guaranteed that d ( u , v ) = d ( v , u ) {\displaystyle d(u,v)=d(v,u)} , and d ( u , v ) {\displaystyle d(u,v)} may be undefined if no directed path from u {\displaystyle u} to v {\displaystyle v} exists.

Related concepts A metric space defined over a set of points in terms of distances in a graph defined over the set is called a graph metric. The vertex set (of an undirected graph) and the distance function form a metric space, if and only if the graph is connected. The eccentricity ϵ(v) of a vertex v is the greatest distance between v and any other vertex; in symbols,

ϵ ( v ) = max u ∈ V d ( v , u ) . {\displaystyle \epsilon (v)=\max _{u\in V}d(v,u).}

It can be thought of as how far a node is from the node most distant from it in the graph. The radius r of a graph is the minimum eccentricity of any vertex or, in symbols,

r = min v ∈ V ϵ ( v ) = min v ∈ V max u ∈ V d ( v , u ) . {\displaystyle r=\min _{v\in V}\epsilon (v)=\min _{v\in V}\max _{u\in V}d(v,u).}

The diameter d of a graph is the maximum eccentricity of any vertex in the graph. That is, d is the greatest distance between any pair of vertices or, alternatively,

d = max v ∈ V ϵ ( v ) = max v ∈ V max u ∈ V d ( v , u ) . {\displaystyle d=\max _{v\in V}\epsilon (v)=\max _{v\in V}\max _{u\in V}d(v,u).}

… excerpt ends here. Continue reading the full article.

Illustrations

Distance (graph theory): Distances in various graphs between selected vertices. Some have no defined distance (marked as infinite distance) because they are in different connected components, or because edges in a directed graph can't lead from the first to the second. The latter may occur even if the distance in the other direction between the same two vertices is defined.
Distances in various graphs between selected vertices. Some have no defined distance (marked as infinite distance) because they are in different connected components, or because edges in a directed graph can't lead from the first to the second. The latter may occur even if the distance in the other direction between the same two vertices is defined.
Distance (graph theory): An example of a simple undirected graph and its corresponding distance matrix.
An example of a simple undirected graph and its corresponding distance matrix.
Distance (graph theory): A directed graph with three vertices A, B, and C illustrating the asymmetric nature of distance in directed graphs. Shows that d(A,B) = 1 via a direct edge, while d(B,A) = 2 requiring traversal through C, demonstrating that directed graph distance is a quasi-metric.
A directed graph with three vertices A, B, and C illustrating the asymmetric nature of distance in directed graphs. Shows that d(A,B) = 1 via a direct edge, while d(B,A) = 2 requiring traversal through C, demonstrating that directed graph distance is a quasi-metric.

Worked examples

Example 1 — a first encounter with Distance (graph theory)

Start with the simplest possible case. Write down what Distance (graph theory) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Distance (graph theory) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Distance (graph theory) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Distance (graph theory)

In research
Distance (graph theory) appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Distance (graph theory) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Distance (graph theory) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Graph distance, Graph theory, Metric geometry, so understanding it makes those chapters shorter.
In everyday life
Look for Distance (graph theory) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Distance (graph theory)” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Distance (graph theory) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Distance (graph theory) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Distance (graph theory) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Distance (graph theory) in simple terms?

In the mathematical field of graph theory, the distance between two vertices in a graph is the number of edges in a shortest path (also called a graph geodesic) connecting them. This is also known as the geodesic distance or shortest-path distance.

Why does Distance (graph theory) matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Distance (graph theory)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Distance (graph theory).

Tags

  • Graph distance
  • Graph theory
  • Metric geometry

Keep exploring