def rebuild_stupid(self): """(Re)build the graph by calculating the combination of all songs. This is a *very* expensive operation which takes quadratic time and only should be ever used for a small amount of songs where accuracy matters even more thant time. """ for song_a, song_b in combinations(self._song_list, 2): distance = Song.distance_compute(song_a, song_b) Song.distance_add(song_a, song_b, distance)
def rebuild_stupid(self): """(Re)build the graph by calculating the combination of all songs. This is a *very* expensive operation which takes quadratic time and only should be ever used for a small amount of songs where accuracy matters even more thant time. """ for song_a, song_b in combinations(self._song_list, 2): distance = Song.distance_compute(song_a, song_b) Song.distance_add(song_a, song_b, distance)