Since different similarity functions can be used within this framework, one may wish to select the one that is the most appropriate or relevant to the task considered.
a crucial requirement for this choice to be realistic is to ensure that for the family of similarity functions considered the expected similarity maximization is efficiently computable.