More optimizations for speed.

1. For two singleton cluster, only compute similarity if they are
neighbors.
2. Add cluster similarity cache.