Why must a distance function satisfy the triangle inequality to be used with metric tree indexes?
Role: Machine Learning Engineer
Category: Machine Learning
Difficulty: hard
Interview Round: Other
Overview: Asks why metric tree indexes such as ball trees and VP-trees need a distance function that satisfies the triangle inequality. Tests how the pruning bound is derived, what fails silently with non-metric distances such as cosine or squared Euclidean, and how to work around them.