Как вариант:
d = { i:j for i,j in [(1, 3), (5, 4), (6, 2), (4, 1), (3, 6), (2, 5)] }
def f(d, k, l):
nk = d.get(k)
new_list.append([k, nk])
k = nk
l -= 1
if not l:
return new_list
return f(d, k, l)
new_list = []
print(f(d, 1, len(d))) # [[1, 3], [3, 6], [6, 2], [2, 5], [5, 4], [4, 1]]
new_list = []
print(f(d, 2, len(d))) # [[2, 5], [5, 4], [4, 1], [1, 3], [3, 6], [6, 2]]
new_list = []
print(f(d, 3, len(d))) # [[3, 6], [6, 2], [2, 5], [5, 4], [4, 1], [1, 3]]
new_list = []
print(f(d, 4, len(d))) # [[4, 1], [1, 3], [3, 6], [6, 2], [2, 5], [5, 4]]
new_list = []
print(f(d, 5, len(d))) # [[5, 4], [4, 1], [1, 3], [3, 6], [6, 2], [2, 5]]
new_list = []
print(f(d, 6, len(d))) # [[6, 2], [2, 5], [5, 4], [4, 1], [1, 3], [3, 6]]
new_list = []
print(f(d, 7, len(d))) # [[7, None], [None, None], [None, None], [None, None], [None, None], [None, None]]
[(1,2) (2,3) (2,4) (4,5) (5,2)]
?