---
title: "DistanceMatrix"
language: "en"
type: "Symbol"
summary: "DistanceMatrix[{u1, u2, ...}] gives the matrix of distances between each pair of elements ui, uj. DistanceMatrix[{u1, u2, ...}, {v1, v2, ...}] gives the matrix of distances between each pair of elements ui, vj."
canonical_url: "https://reference.wolfram.com/language/ref/DistanceMatrix.html"
source: "Wolfram Language Documentation"
related_guides: 
  - 
    title: "Distance and Similarity Measures"
    link: "https://reference.wolfram.com/language/guide/DistanceAndSimilarityMeasures.en.md"
  - 
    title: "Operations on Vectors"
    link: "https://reference.wolfram.com/language/guide/OperationsOnVectors.en.md"
  - 
    title: "Sequence Alignment & Comparison"
    link: "https://reference.wolfram.com/language/guide/SequenceAlignmentAndComparison.en.md"
  - 
    title: "Text Analysis"
    link: "https://reference.wolfram.com/language/guide/TextAnalysis.en.md"
  - 
    title: "Natural Language Processing"
    link: "https://reference.wolfram.com/language/guide/NaturalLanguageProcessing.en.md"
related_functions: 
  - 
    title: "Outer"
    link: "https://reference.wolfram.com/language/ref/Outer.en.md"
  - 
    title: "NearestNeighborGraph"
    link: "https://reference.wolfram.com/language/ref/NearestNeighborGraph.en.md"
  - 
    title: "AdjacencyMatrix"
    link: "https://reference.wolfram.com/language/ref/AdjacencyMatrix.en.md"
  - 
    title: "GraphDistanceMatrix"
    link: "https://reference.wolfram.com/language/ref/GraphDistanceMatrix.en.md"
  - 
    title: "Nearest"
    link: "https://reference.wolfram.com/language/ref/Nearest.en.md"
  - 
    title: "Norm"
    link: "https://reference.wolfram.com/language/ref/Norm.en.md"
  - 
    title: "ClusterClassify"
    link: "https://reference.wolfram.com/language/ref/ClusterClassify.en.md"
  - 
    title: "FindClusters"
    link: "https://reference.wolfram.com/language/ref/FindClusters.en.md"
  - 
    title: "DistanceFunction"
    link: "https://reference.wolfram.com/language/ref/DistanceFunction.en.md"
---
# DistanceMatrix

DistanceMatrix[{u1, u2, …}] gives the matrix of distances between each pair of elements ui, uj. 

DistanceMatrix[{u1, u2, …}, {v1, v2, …}] gives the matrix of distances between each pair of elements ui, vj.

## Details and Options

* ``DistanceMatrix`` works for a variety of data, including numerical, geospatial, textual, visual, dates and times, as well as combinations of these.

* Each ``ui`` can be a single data element, a list of data elements or an association of data elements. In ``DistanceMatrix[data, …]``, ``data`` can also be a ``Dataset`` object.

* The following options can be given:

|                   |           |                                                                   |
| ----------------- | --------- | ----------------------------------------------------------------- |
| DistanceFunction  | Automatic | the distance metric to use                                        |
| FeatureExtractor  | Identity  | how to preprocess data                                            |
| FeatureNames      | Automatic | feature names to assign for data                                  |
| FeatureTypes      | Automatic | feature types to assume for data                                  |
| PerformanceGoal   | Automatic | aspects of performance to try to optimize                         |
| RandomSeeding     | 1234      | what seeding of pseudorandom generators should be done internally |
| WorkingPrecision  | Automatic | precision to use for numerical data                               |

* The setting for ``DistanceFunction`` can be any distance or dissimilarity function or a function ``f`` defining a distance between two values.

* By default, the following distance functions are used for different types of elements:

|                              |                            |
| ---------------------------- | -------------------------- |
| EuclideanDistance            | numeric data               |
| ImageDistance                | images                     |
| JaccardDissimilarity         | Boolean data               |
| EditDistance                 | text and nominal sequences |
| Abs[DateDifference[#1, #2]]& | dates and times            |
| ColorDistance                | colors                     |
| GeoDistance                  | geospatial data            |
| Boole[SameQ[#1, #2]]&        | nominal data               |
| HammingDistance              | nominal vector data        |
| WarpingDistance              | numerical sequences        |

* For images, colors or audio objects and a distance function ``f``, ``DistanceFunction -> f`` is passed to ``ImageDistance``, ``ColorDistance`` or ``AudioDistance``, respectively. »

* All images are first conformed using ``ConformImages``.

* By default, when data elements are mixed-type vectors, distances are computed independently for each type and combined using ``Norm``.

* Possible settings for ``PerformanceGoal`` include:

|           |                                                |
| --------- | ---------------------------------------------- |
| "Speed"   | minimize computation time                      |
| "Quality" | maximize precision and accuracy                |
| Automatic | automatic tradeoff between speed and precision |

* Possible settings for ``RandomSeeding`` include:

|           |                                                        |
| --------- | ------------------------------------------------------ |
| Automatic | automatically reseed every time the function is called |
| Inherited | use externally seeded random numbers                   |
| seed      | use an explicit integer or strings as a seed           |

---

## Examples (23)

### Basic Examples (3)

Compute a distance matrix from a list of integers:

```wl
In[1]:= dm = DistanceMatrix[{1, 2, 3, 4}]

Out[1]= {{0, 1, 2, 3}, {1, 0, 1, 2}, {2, 1, 0, 1}, {3, 2, 1, 0}}

In[2]:= dm // MatrixForm

Out[2]//MatrixForm=
(⁠|   |   |   |   |
| - | - | - | - |
| 0 | 1 | 2 | 3 |
| 1 | 0 | 1 | 2 |
| 2 | 1 | 0 | 1 |
| 3 | 2 | 1 | 0 |⁠)
```

---

Compute a distance matrix from two lists of integers:

```wl
In[1]:= dm = DistanceMatrix[{1, 2, 3, 4}, {5, 6, 7}]

Out[1]= {{4, 5, 6}, {3, 4, 5}, {2, 3, 4}, {1, 2, 3}}

In[2]:= dm // MatrixForm

Out[2]//MatrixForm=
(⁠|   |   |   |
| - | - | - |
| 4 | 5 | 6 |
| 3 | 4 | 5 |
| 2 | 3 | 4 |
| 1 | 2 | 3 |⁠)
```

---

Compute a distance matrix from real-valued numerical vectors:

```wl
In[1]:= dm = DistanceMatrix[{{1.5, 4.3}, {2.1, 5.6}, {6.2, 4.5}}, {{1.6, 4.2}, {2.3, 5.4}}]

Out[1]= {{0.141421, 1.36015}, {1.48661, 0.282843}, {4.60977, 4.0025}}

In[2]:= dm // MatrixForm

Out[2]//MatrixForm=
(⁠|          |          |
| -------- | -------- |
| 0.141421 | 1.36015  |
| 1.48661  | 0.282843 |
| 4.60977  | 4.0025   |⁠)
```

### Scope (10)

Compute a distance matrix from images:

```wl
In[1]:= DistanceMatrix[{[image], [image], [image]}] // MatrixForm

Out[1]//MatrixForm=
(⁠|         |         |         |
| ------- | ------- | ------- |
| 0.      | 72.1014 | 54.7722 |
| 72.1014 | 0.      | 63.7609 |
| 54.7722 | 63.7609 | 0.      |⁠)
```

---

Compute a distance matrix from strings:

```wl
In[1]:= DistanceMatrix[{"abcd", "bcde", "xyz"}] // MatrixForm

Out[1]//MatrixForm=
(⁠|   |   |   |
| - | - | - |
| 0 | 2 | 4 |
| 2 | 0 | 4 |
| 4 | 4 | 0 |⁠)
```

---

Compute a distance matrix from Boolean vectors:

```wl
In[1]:= DistanceMatrix[{{True, False, True}, {True, True, True}, {True, False, False}}] // MatrixForm

Out[1]//MatrixForm=
(⁠|       |       |       |
| ----- | ----- | ----- |
| 0     | (1/3) | (1/2) |
| (1/3) | 0     | (2/3) |
| (1/2) | (2/3) | 0     |⁠)
```

---

Compute a distance matrix from a list of date objects:

```wl
In[1]:= DistanceMatrix[{DateObject[{1985, 10, 3}], DateObject[{1989, 5, 30}], DateObject[]}] // MatrixForm

Out[1]//MatrixForm=
(⁠|                                     |                                     |                                     |
| ----------------------------------- | ----------------------------------- | ----------------------------------- |
| Quantity[0,  ... 88, "Days"] |
| Quantity[1335, "Days"]              | Quantity[0, "Days"]                 | Quantity[10108.90394798088, "Days"] |
| Quantity[11443.90394798088, "Days"] | Quantity[10108.90394798088, "Days"] | Quantity[0., "Days"]                |⁠)
```

---

Compute a distance matrix from geodetic positions:

```wl
In[1]:= DistanceMatrix[{GeoPosition[Entity["City", {"Paris", "IleDeFrance", "France"}]], GeoPosition[Entity["City", {"Sydney", "NewSouthWales", "Australia"}]], GeoPosition[Entity["City", {"Boston", "Massachusetts", "UnitedStates"}]], GeoPosition[Entity["City", {"SanFrancisco", "California", "UnitedStates"}]]}] // MatrixForm

Out[1]//MatrixForm=
(⁠|                                       |                                       |                                       |                                       |
| ------------------------------------- | ------------------------------------- | -- ... ] | Quantity[0., "Miles"]                 | Quantity[2703.0545576783597, "Miles"] |
| Quantity[5578.400217467217, "Miles"]  | Quantity[7414.381091948039, "Miles"]  | Quantity[2703.0545576783597, "Miles"] | Quantity[0., "Miles"]                 |⁠)
```

---

Compute a distance matrix from nominal sequences:

```wl
In[1]:= DistanceMatrix[{{"a", "b", "c", "d"}, {"b", "c", "d", "e"}, {"x", "y", "z"}}] // MatrixForm

Out[1]//MatrixForm=
(⁠|   |   |   |
| - | - | - |
| 0 | 2 | 4 |
| 2 | 0 | 4 |
| 4 | 4 | 0 |⁠)
```

---

Compute a distance matrix from numerical sequences:

```wl
In[1]:= DistanceMatrix[{{1.1, 1.2, 1.3, 1.4, 1.5}, {1.2, 1.3}, {1.4, 1.5, 1.6}}] // MatrixForm

Out[1]//MatrixForm=
(⁠|     |     |     |
| --- | --- | --- |
| 0.  | 0.4 | 0.7 |
| 0.4 | 0.  | 0.7 |
| 0.7 | 0.7 | 0.  |⁠)
```

---

Compute a distance matrix on nominal vectors:

```wl
In[1]:= DistanceMatrix[{{"A", "Sugar"}, {"A", "Salt"}, {"B", "Sugar"}, {"B", "Salt"}}]//MatrixForm

Out[1]//MatrixForm=
(⁠|   |   |   |   |
| - | - | - | - |
| 0 | 1 | 1 | 2 |
| 1 | 0 | 2 | 1 |
| 1 | 2 | 0 | 1 |
| 2 | 1 | 1 | 0 |⁠)
```

---

Compute a distance matrix from mixed-type vectors:

```wl
In[1]:= DistanceMatrix[{{1.2, "A"}, {3.1, "A"}, {1.1, "B"}, {3.3, "B"}}] // MatrixForm

Out[1]//MatrixForm=
(⁠|         |         |         |         |
| ------- | ------- | ------- | ------- |
| 0.      | 1.9     | 1.00499 | 2.32594 |
| 1.9     | 0.      | 2.23607 | 1.0198  |
| 1.00499 | 2.23607 | 0.      | 2.2     |
| 2.32594 | 1.0198  | 2.2     | 0.      |⁠)
```

---

Compute a distance matrix from a dataset formatted as a list of associations:

```wl
In[1]:=
data = {<|"age" -> 32, "height" -> 160, "gender" -> "female"|>, 
	<|"height" -> 183, "age" -> 41, "gender" -> "female"|>, 
	<|"height" -> 123, "age" -> 30, "gender" -> "female"|>, 
	<|"height" -> 175, "age" -> 21, "gender" -> "male"|>, 
	<|"height" -> 150, "age" -> 11, "gender" -> "male"|>, 
	<|"age" -> 52, "height" -> 164, "gender" -> "female"|>};

In[2]:= DistanceMatrix[data]//MatrixForm

Out[2]//MatrixForm=
(⁠|            |            |            |            |            |            |
| ---------- | ---------- | ---------- | ---------- | ---------- | ---------- |
| 0          | Sqrt[610]  | Sqrt[1373] | Sqrt[347]  | Sqrt[542]  | 4 Sqrt[26] |
| Sqrt ... 65] |
| Sqrt[347]  | Sqrt[465]  | Sqrt[2786] | 0          | 5 Sqrt[29] | 19 Sqrt[3] |
| Sqrt[542]  | Sqrt[1990] | Sqrt[1091] | 5 Sqrt[29] | 0          | Sqrt[1878] |
| 4 Sqrt[26] | Sqrt[482]  | Sqrt[2165] | 19 Sqrt[3] | Sqrt[1878] | 0          |⁠)
```

Compute the same distance matrix with a column-oriented dataset:

```wl
In[3]:= DistanceMatrix[<|"age" -> {32, 41, 30, 21, 11, 52}, "height" -> {160, 183, 123, 175, 150, 164}, "gender" -> {"female", "female", "female", "male", "male", "female"}|>]//MatrixForm

Out[3]//MatrixForm=
(⁠|            |            |            |            |            |            |
| ---------- | ---------- | ---------- | ---------- | ---------- | ---------- |
| 0          | Sqrt[610]  | Sqrt[1373] | Sqrt[347]  | Sqrt[542]  | 4 Sqrt[26] |
| Sqrt ... 65] |
| Sqrt[347]  | Sqrt[465]  | Sqrt[2786] | 0          | 5 Sqrt[29] | 19 Sqrt[3] |
| Sqrt[542]  | Sqrt[1990] | Sqrt[1091] | 5 Sqrt[29] | 0          | Sqrt[1878] |
| 4 Sqrt[26] | Sqrt[482]  | Sqrt[2165] | 19 Sqrt[3] | Sqrt[1878] | 0          |⁠)
```

Data can also be given in a ``Dataset`` object:

```wl
In[4]:= dataset = Dataset[data]

Out[4]= Dataset[<>]

In[5]:= DistanceMatrix[dataset]//MatrixForm

Out[5]//MatrixForm=
(⁠|            |            |            |            |            |            |
| ---------- | ---------- | ---------- | ---------- | ---------- | ---------- |
| 0          | Sqrt[610]  | Sqrt[1373] | Sqrt[347]  | Sqrt[542]  | 4 Sqrt[26] |
| Sqrt ... 65] |
| Sqrt[347]  | Sqrt[465]  | Sqrt[2786] | 0          | 5 Sqrt[29] | 19 Sqrt[3] |
| Sqrt[542]  | Sqrt[1990] | Sqrt[1091] | 5 Sqrt[29] | 0          | Sqrt[1878] |
| 4 Sqrt[26] | Sqrt[482]  | Sqrt[2165] | 19 Sqrt[3] | Sqrt[1878] | 0          |⁠)
```

### Options (9)

#### DistanceFunction (3)

Compute a distance matrix from integer vectors using ``SquaredEuclideanDistance`` as a distance function:

```wl
In[1]:= DistanceMatrix[{{1, 5}, {2, 3}, {3, 1}, {4, 7}}, DistanceFunction -> SquaredEuclideanDistance] // MatrixForm

Out[1]//MatrixForm=
(⁠|    |    |    |    |
| -- | -- | -- | -- |
| 0  | 5  | 20 | 13 |
| 5  | 0  | 5  | 20 |
| 20 | 5  | 0  | 37 |
| 13 | 20 | 37 | 0  |⁠)
```

---

Compute a distance matrix with the ``ManhattanDistance`` :

```wl
In[1]:= DistanceMatrix[{{1.3, 5.2}, {1.2, 7.3}, {3.6, 1.1}, {4.6, 7.4}}, DistanceFunction -> ManhattanDistance] // MatrixForm

Out[1]//MatrixForm=
(⁠|     |     |     |     |
| --- | --- | --- | --- |
| 0.  | 2.2 | 6.4 | 5.5 |
| 2.2 | 0.  | 8.6 | 3.5 |
| 6.4 | 8.6 | 0.  | 7.3 |
| 5.5 | 3.5 | 7.3 | 0.  |⁠)
```

---

Use a color distance different from the default distance:

```wl
In[1]:= DistanceMatrix[{RGBColor[0.8153963685313876, 0.8780324414500478, 0.8878969785400366], RGBColor[0.7000498357974252, 0.12659377056191357, 0.2441846342253282], RGBColor[0.22075683601648843, 0.11406627268342273, 0.5155520370226843], RGBColor[0.7106648135050211, 0.42410292720247544, 0.14462936430464635], RGBColor[0.46490866303974765, 0.16254211516915973, 0.6466382153254229]}, DistanceFunction -> "CIE2000"]

Out[1]= {{0., 0.496008, 0.672398, 0.405738, 0.500043}, {0.496008, 0., 0.370715, 0.288743, 0.309892}, {0.672398, 0.370715, 0., 0.555484, 0.124528}, {0.405738, 0.288743, 0.555484, 0., 0.519371}, {0.500043, 0.309892, 0.124528, 0.519371, 0.}}
```

#### FeatureExtractor (1)

Compute a distance matrix from images preprocessed by the feature extractor method ``"NumericVector"`` :

```wl
In[1]:= DistanceMatrix[{[image], [image], [image], [image], [image], [image]}, FeatureExtractor -> "NumericVector"] // MatrixPlot

Out[1]= [image]
```

#### FeatureNames (1)

Use ``FeatureNames`` to name features, and refer to their names in further specifications:

```wl
In[1]:= DistanceMatrix[{{2.3, "male"}, {4.8, Missing[]}, {Missing[], "female"}, {5.2, "female"}}, FeatureNames -> {"gender", "age"}, FeatureTypes -> <|"gender" -> "Numerical", "age" -> "Nominal"|>]

Out[1]= {{0., 2.69258, 2.05913, 3.06757}, {2.69258, 0., 1.22066, 1.07703}, {2.05913, 1.22066, 0., 1.1}, {3.06757, 1.07703, 1.1, 0.}}
```

#### FeatureTypes (1)

Use ``FeatureTypes`` to enforce the interpretation of the first feature as nominal:

```wl
In[1]:= DistanceMatrix[{{1, "A"}, {2, "A"}, {2, "B"}, {1, "B"}}, FeatureTypes -> <|1 -> "Nominal"|>]// MatrixForm

Out[1]//MatrixForm=
(⁠|   |   |   |   |
| - | - | - | - |
| 0 | 1 | 2 | 1 |
| 1 | 0 | 1 | 2 |
| 2 | 1 | 0 | 1 |
| 1 | 2 | 1 | 0 |⁠)
```

#### PerformanceGoal (1)

Generate 2000 random numerical vectors of length 1000:

```wl
In[1]:= vectors = RandomReal[{10, 11}, {2000, 1000}];
```

Compute their distance matrix and benchmark the operation:

```wl
In[2]:= AbsoluteTiming[result = DistanceMatrix[vectors];]

Out[2]= {0.33399, Null}
```

Perform the same operation with ``PerformanceGoal`` set to ``"Speed"`` :

```wl
In[3]:= AbsoluteTiming[resultspeed = DistanceMatrix[vectors, PerformanceGoal -> "Speed"];]

Out[3]= {0.111662, Null}
```

Compare timing and accuracies of the previous results with a reference:

```wl
In[4]:= AbsoluteTiming[reference = Outer[EuclideanDistance, vectors, vectors, 1];]

Out[4]= {7.00108, Null}

In[5]:= StandardDeviation[Flatten[result - reference]]

Out[5]= 1.6925836340441326`*^-15

In[6]:= StandardDeviation[Flatten[resultspeed - reference]]

Out[6]= 1.3104447807676083`*^-7
```

When ``PerformanceGoal -> "Speed"``, centering the data can increase the precision:

```wl
In[7]:=
mean = Mean[vectors];
centered = # - mean & /@ vectors;

In[8]:= AbsoluteTiming[resultspeedcentered = DistanceMatrix[centered, PerformanceGoal -> "Speed"];]

Out[8]= {0.106464, Null}

In[9]:= StandardDeviation[Flatten[resultspeedcentered - reference]]

Out[9]= 3.5020261566829727`*^-9
```

#### RandomSeeding (1)

``DistanceMatrix`` gives the same result when evaluated multiple times, even when randomness is involved.

Generate a pair of 20-dimensional vectors:

```wl
In[1]:= data = RandomReal[1, {2, 20}];
```

Compute its distance matrix several times using a feature extractor involving randomness:

```wl
In[2]:= table = Table[DistanceMatrix[data, FeatureExtractor -> (RandomChoice[#, 10]&)], 5];
```

Compare the results:

```wl
In[3]:= Counts[table]

Out[3]= <|{{0., 1.45497}, {1.45497, 0.}} -> 5|>
```

Use different values for the ``RandomSeeding`` option to compute the distance matrices:

```wl
In[4]:= randomtable = Table[DistanceMatrix[data, FeatureExtractor -> (RandomChoice[#, 10]&), RandomSeeding -> RandomInteger[10]], 5];
```

Compare the results:

```wl
In[5]:= Counts[randomtable]

Out[5]= <|{{0., 1.22916}, {1.22916, 0.}} -> 1, {{0., 1.14498}, {1.14498, 0.}} -> 1, {{0., 1.35687}, {1.35687, 0.}} -> 1, {{0., 1.37199}, {1.37199, 0.}} -> 1, {{0., 0.884021}, {0.884021, 0.}} -> 1|>
```

#### WorkingPrecision (1)

Compute the distance matrix for 500 random numerical vectors of length 100 that have a precision of 30:

```wl
In[1]:= r = RandomReal[1, {500, 100}, WorkingPrecision -> 30];

In[2]:= AbsoluteTiming[dm = DistanceMatrix[r];]

Out[2]= {5.81149, Null}
```

``DistanceMatrix`` uses arbitrary-precision computation:

```wl
In[3]:= Precision[dm]

Out[3]= 22.5065
```

Using ``WorkingPrecision -> MachinePrecision`` can speed up the computation:

```wl
In[4]:= AbsoluteTiming[dmmachine = DistanceMatrix[r, WorkingPrecision -> MachinePrecision];]

Out[4]= {0.008592, Null}
```

But the results are not as precise:

```wl
In[5]:= Precision[dmmachine]

Out[5]= MachinePrecision
```

When vectors are similar, changing the value of ``WorkingPrecision`` can lead to significantly different results:

```wl
In[6]:= r = RandomReal[{10 ^ 20, 10 ^ 20 + 1}, {3, 2}, WorkingPrecision -> 30]

Out[6]= {{1.0000000000000000000083316361662846256900736162624031457829`30.*^20, 1.0000000000000000000033139514024394138034779527720802149585`30.*^20}, {1.0000000000000000000012621533944174417751103550394176793247`30.*^20, 1.0000000000000000000087935284980191320762610877437629421355`30.*^20}, {1.0000000000000000000058533613461272754352803939353308754891`30.*^20, 1.0000000000000000000081823196662613706072366839641840267427`30.*^20}}

In[7]:= DistanceMatrix[r] // MatrixForm

Out[7]//MatrixForm=
(⁠|             |             |             |
| ----------- | ----------- | ----------- |
| 0           | 0.894445928 | 0.546286149 |
| 0.894445928 | 0           | 0.46317131  |
| 0.546286149 | 0.46317131  | 0           |⁠)

In[8]:= DistanceMatrix[r, WorkingPrecision -> MachinePrecision] // MatrixForm

Out[8]//MatrixForm=
(⁠|    |    |    |
| -- | -- | -- |
| 0. | 0. | 0. |
| 0. | 0. | 0. |
| 0. | 0. | 0. |⁠)
```

### Applications (1)

Find the minimum distance between two sets of points:

```wl
In[1]:=
p1 = RandomPoint[Sphere[], 20];
p2 = RandomPoint[Sphere[{3, 2, 5}], 20];
ListPointPlot3D[{p1, p2}, AspectRatio -> 1]

Out[1]= [image]

In[2]:= Min[DistanceMatrix[p1, p2]]

Out[2]= 4.28215
```

## See Also

* [`Outer`](https://reference.wolfram.com/language/ref/Outer.en.md)
* [`NearestNeighborGraph`](https://reference.wolfram.com/language/ref/NearestNeighborGraph.en.md)
* [`AdjacencyMatrix`](https://reference.wolfram.com/language/ref/AdjacencyMatrix.en.md)
* [`GraphDistanceMatrix`](https://reference.wolfram.com/language/ref/GraphDistanceMatrix.en.md)
* [`Nearest`](https://reference.wolfram.com/language/ref/Nearest.en.md)
* [`Norm`](https://reference.wolfram.com/language/ref/Norm.en.md)
* [`ClusterClassify`](https://reference.wolfram.com/language/ref/ClusterClassify.en.md)
* [`FindClusters`](https://reference.wolfram.com/language/ref/FindClusters.en.md)
* [`DistanceFunction`](https://reference.wolfram.com/language/ref/DistanceFunction.en.md)

## Related Guides

* [Distance and Similarity Measures](https://reference.wolfram.com/language/guide/DistanceAndSimilarityMeasures.en.md)
* [Operations on Vectors](https://reference.wolfram.com/language/guide/OperationsOnVectors.en.md)
* [Sequence Alignment & Comparison](https://reference.wolfram.com/language/guide/SequenceAlignmentAndComparison.en.md)
* [Text Analysis](https://reference.wolfram.com/language/guide/TextAnalysis.en.md)
* [Natural Language Processing](https://reference.wolfram.com/language/guide/NaturalLanguageProcessing.en.md)

## History

* [Introduced in 2015 (10.3)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn103.en.md) \| [Updated in 2017 (11.1)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn111.en.md) ▪ [2017 (11.2)](https://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn112.en.md)