Implement Fedorenko algorithm.