Distance metric for algorithms

I am currently working on a project in which I need to quantify (dis) the similarity between the algorithms - that is, I have several dozen algorithms that are used for the same purpose, and I would like to quantify which ones are closer ( that is, are more similar) to others, and which are really β€œnew.”

Both of my Google-Fu and my SO-Jutsu let me down, so I would appreciate it if anyone could shed some light on this. Is there such a metric?

+4
source share
1 answer

As one of the indicators of similarity, you can create a data set nthat is somewhat intelligently designed, and then run each of your algorithms on all of these data sets. Then you get a n-dimensional runtime vector associated with each algorithm, which can then be dropped to any old distance. I would suggest that something like cosine distance would be a good guess, because if your datasets are of different sizes, you would like to classify your algorithms as they scale. In addition to runtime, you can keep track of maximum memory usage or anything you can think of for measurement.

+2
source

Source: https://habr.com/ru/post/1614904/


All Articles