Creating a similarity graph