Molecular similarity and diversity in chemoinformatics: From theory to applications