lundi 4 septembre 2017

Neat way to merge similar programs into one

I'm new to stackoverflow and I tried as hard as I could to search for my problem in the previous questions, and although I'm pretty sure it should've been asked before I'm not sure what to exactly search for.

so my problem is that I have a set of programs that calculate a certain property of a graph and construct a great number of graphs in their loops. all of these programs are the same, except that I use different random graphs in each of them. for example one works for grid graphs, one for Erdos-Renyi graphs and etc. what is the best way to merge them into one?

I thought about adding an "if" inside the loop, so every time a new graph is being constructed, it checks that which set of random graphs is being used, but wouldn't it increase the execution time? I want to know what is the standard way of handling this problem. thanks.

Aucun commentaire:

Enregistrer un commentaire