Minkowski Distance (Lₚ-Norm)

Calculator for the Minkowski distance with formulas and examples

Minkowski Distance Calculator

What is calculated?

The Minkowski distance (also called the Lₚ-norm) is a generalization of Euclidean and Manhattan distances. The parameter p determines the type of distance measurement.

Input parameters

p=1: Manhattan, p=2: Euclidean, p=∞: Chebyshev

Coordinates separated by spaces

Same number of coordinates as X

Result
Minkowski distance (Lₚ):
General distance formula for different p values

Minkowski Info

Properties

Minkowski distance:

  • Generalized Lₚ-norm
  • Parameter p ≥ 1 required
  • Special cases: Manhattan, Euclidean
  • Limit: Chebyshev (p→∞)

Flexibility: By adjusting p you can cover different distance types and application scenarios.

Special cases
p = 1
Manhattan distance
p = 2
Euclidean distance
p = 3
Cubic norm
p = ∞
Chebyshev distance


Formulas for Minkowski distance

Basic formula (Lₚ-norm)
\[d_p(x,y) = \left(\sum_{i=1}^n |x_i - y_i|^p\right)^{1/p}\] General Minkowski distance
Vector norm
\[d_p(x,y) = \|x-y\|_p\] Lₚ-norm of the difference
Manhattan (p=1)
\[d_1(x,y) = \sum_{i=1}^n |x_i - y_i|\] L₁-norm (Taxicab)
Euclidean (p=2)
\[d_2(x,y) = \sqrt{\sum_{i=1}^n (x_i - y_i)^2}\] L₂-norm (standard)
Chebyshev (p→∞)
\[d_\infty(x,y) = \max_{i=1}^n |x_i - y_i|\] L∞-norm (maximum)
Weighted form
\[d_{p,w}(x,y) = \left(\sum_{i=1}^n w_i |x_i - y_i|^p\right)^{1/p}\] With weights wᵢ

Detailed calculation example

Example: Minkowski([3,4,5], [2,3,6], p=3)

Given:

  • Point A = [3, 4, 5]
  • Point B = [2, 3, 6]
  • Parameter p = 3

Step 1 - Absolute differences:

  • |3 - 2| = 1
  • |4 - 3| = 1
  • |5 - 6| = 1

Step 2 - Power (p=3):

  • 1³ = 1
  • 1³ = 1
  • 1³ = 1

Step 3 - Sum and root:

\[d_3 = (1 + 1 + 1)^{1/3} = 3^{1/3} \approx 1.442\]

Interpretation: The cubic Minkowski distance is about 1.442, between Manhattan (3.0) and Euclidean (1.732).

p-value comparison

For points [0,0] and [3,4] at different p values
p = 1 (Manhattan)
7.000

|3| + |4| = 7

p = 2 (Euclidean)
5.000

√(3² + 4²) = 5

p = 3 (Cubic)
4.498

(3³ + 4³)^(1/3)

p = ∞ (Chebyshev)
4.000

max(3, 4) = 4

Observation: As p increases the distance approaches the maximum value.

\[\lim_{p \to \infty} \left(\sum_{i=1}^n |x_i - y_i|^p\right)^{1/p} = \max_{i=1}^n |x_i - y_i|\]

Unit ball shapes

How the unit ball changes with p

2D unit balls (d ≤ 1):

  • p = 1: Diamond ♦
  • p = 2: Circle ●
  • p = 4: Superellipse (flattened)
  • p = ∞: Square ■

3D unit balls (d ≤ 1):

  • p = 1: Octahedron (8 faces)
  • p = 2: Sphere
  • p = 4: Supersphere
  • p = ∞: Cube

Trend: Smaller p values → sharper shapes, larger p values → squarer shapes

Practical applications

Machine Learning
  • k-Nearest Neighbors (various p)
  • Clustering algorithms
  • Similarity measurement
  • Feature matching
Data analysis
  • Outlier detection
  • Data quality
  • Multivariate statistics
  • Dimensionality reduction
Computer graphics
  • Collision detection
  • Pathfinding
  • Texture matching
  • 3D modeling

Mathematical properties

Norm properties (p ≥ 1)
  • Positivity: ‖x‖ₚ ≥ 0, ‖x‖ₚ = 0 ⟺ x = 0
  • Homogeneity: ‖αx‖ₚ = |α|‖x‖ₚ
  • Triangle inequality: ‖x+y‖ₚ ≤ ‖x‖ₚ + ‖y‖ₚ
  • Monotonicity: ‖x‖∞ ≤ ‖x‖ₚ ≤ ‖x‖₁ for p ≥ 1
Convergence properties
  • Limit: lim[p→∞] ‖x‖ₚ = ‖x‖∞
  • Continuity: ‖x‖ₚ is continuous in p
  • Monotone relation: p₁ < p₂ ⟹ ‖x‖ₚ₂ ≤ ‖x‖ₚ₁
  • Hölder inequality: Basis for triangle inequality
Relations between norms

General relation:
‖x‖∞ ≤ ‖x‖ₚ ≤ n^(1/p) ‖x‖∞

Specific inequalities:
‖x‖₂ ≤ ‖x‖₁ ≤ √n ‖x‖₂

p-parameter selection guide

When to use which p value?

p = 1 (Manhattan):

  • Urban planning, navigation
  • Robust to outliers
  • Sparse data, LASSO
  • Discrete/raster problems

p = 2 (Euclidean):

  • Physical distances
  • Standard ML algorithms
  • Gaussian distributions
  • "Natural" geometric distance

p > 2 (Higher norms):

  • Emphasize dominant dimensions
  • Less outlier-sensitive
  • Specialized applications
  • Approaches maximum norm

p = ∞ (Chebyshev):

  • Worst-case scenarios
  • Approximation theory
  • Chessboard distance
  • Uniform norms