@skirpichev @smichr  I am now able to provide random fractions to the functions for testing. A problem I am facing is that, random gives me large numerators & denominators, and the greedy algorithm(which i have also kept as the default one) works fine with large numbers , but Takenouchi gives MemoryError and Graham Jewett takes a lot of time(due to the nature of the algorithm, but it doesnt give an error) .. So what do you think I should do now ? A reason why I have kept multiple algorithms is that each algorithm gives different results, so if someone would want to see how the algorithms differ, providing multiple algorithms would help them appreciate the differences in results. So, can i do this ... if an error occurs during the calculation of results(due to MemoryError or if time take exceeds a limit(eg 10 seconds)), then results will be generated by the greedy algorithm instead and a message will be displayed at the bottom stating that due to this and this reason the results cannot be generated by the asked algorithm.