A graph satisfies the triangle inequality if for any three vertices .