add unique_path algorithm