I'm doing a challenge and it has posed a problem I am unfamiliar with. It goes like this, You start with two numbers, 1 and 1. You can combine the numbers in either direction, in this case makes 2,1 and 1,2 or in the case of 3,2 it would produce 5,2 or 3,5. Always starting from 1,1 my challenge is to try to find a pair of numbers in as few "moves" as possible.
My first pass was to build a greedy-first SSS* like algorithm. Works well for a small space but in the end takes too long on large inputs. So I think I have to massively narrow the search. Or I'm sure someone has seen this before and has come up with a clever workaround.
Any help is appreciated