compute similarity of items