all_paths_algorithm - fix