A metric space M is a tuple (D,d), where D is a domain of objects and d:D×D→R is a total (distance) function, satisfying the following properties:
For all x,y,z∈D:
- d(x,y)≥0,
- d(x,y)=d(y,x),
- x=y⇔d(x,y)=0,
- d(x,z)≤d(x,y)+d(y,z).
Zezula, P., Amato, G., Dohnal, V., & Batko, M. (2006). Similarity search: the metric space approach (Vol. 32). Springer Science & Business Media.