{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $(M, d)$ be a [[metric space|0VKD1TP7F3]].\nFor $x \\in M$ and a nonempty subset $S \\subseteq M$, let $d(x, S) = \\inf_{s \\in S} d(x, s)$, an [[infimum|0QF1MZ9FRG]].\nThe *Hausdorff distance* between nonempty subsets $A, B \\subseteq M$ is\n$$d_H(A, B) = \\max\\Big\\{ \\sup_{a \\in A} d(a, B), \\ \\sup_{b \\in B} d(b, A) \\Big\\} \\in [0, +\\infty],$$\nwhere $\\sup$ is the [[supremum|0R3H5PANRQ]].\n\n## Remarks\n\nEquivalently, $d_H(A, B)$ is the infimum of the $\\varepsilon \\ge 0$ with $A \\subseteq B_\\varepsilon$ and $B \\subseteq A_\\varepsilon$, where $S_\\varepsilon = \\set{x \\in M : d(x, S) \\le \\varepsilon}$.\nIn $\\R^n$ with the Euclidean distance and closed unit ball $D$, this reads $d_H(A, B) = \\inf\\set{\\varepsilon \\ge 0 : A \\subseteq B + \\varepsilon D, \\ B \\subseteq A + \\varepsilon D}$ for nonempty compact $A, B$, with [[Minkowski sums|SXS6D87PHE]].\n\nExample: $A = [0, 1]$ and $B = [0, 2]$ in $\\R$.\nEvery point of $A$ lies in $B$, so $\\sup_{a \\in A} d(a, B) = 0$; the points of $B$ have $d(b, A) = \\max(b - 1, 0)$, with supremum $1$ at $b = 2$.\nSo $d_H(A, B) = 1$.\n\nNon-example of a metric: on all nonempty subsets, $d_H$ is not a metric.\nFor $A = (0, 1)$ and $B = [0, 1]$ in $\\R$ one has $d_H(A, B) = 0$ although $A \\neq B$, and $d_H(\\set{0}, [0, \\infty)) = +\\infty$.\nOn the nonempty closed bounded subsets of $M$, and in particular on the nonempty compact subsets, $d_H$ is a metric.\nIf $M$ is complete, then so is this space of closed bounded subsets; if $M$ is compact, then so is the space of nonempty compact subsets.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "F79WYYC07C",
    "kind": "definition",
    "msc": [
      "54E35",
      "52A20",
      "54B20"
    ],
    "name": "Hausdorff distance",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Hausdorff_distance"
      }
    ],
    "tag": "DQEW4MSD5H",
    "uses": [
      "0VKD1TP7F3",
      "0R3H5PANRQ",
      "0QF1MZ9FRG"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/DQEW4MSD5H/",
  "links": [
    {
      "field": "defines",
      "target": "F79WYYC07C"
    },
    {
      "field": "uses",
      "target": "0VKD1TP7F3"
    },
    {
      "field": "uses",
      "target": "0R3H5PANRQ"
    },
    {
      "field": "uses",
      "target": "0QF1MZ9FRG"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/DQEW4MSD5H.md",
  "msc": [
    "54E35",
    "52A20",
    "54B20"
  ],
  "name": "Hausdorff distance",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/DQE/DQEW4MSD5H.md",
  "status": null,
  "tag": "DQEW4MSD5H",
  "uri": "m2://DQEW4MSD5H",
  "url": "https://tamnd.github.io/math2/wiki/hausdorff-distance-definition/",
  "writing": {
    "tag": "DQEW4MSD5H",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
