lewen
January 8th, 2008, 02:38 AM
Hello,
I was given an assignment by my teacher to implement some algorithm and analyze its practical running time versus theoretical.
With algorithms running in O(n^2) it's seems to be rather simple. Get execution times for different inputs. Plot on a graph and check if the plotted function behaves anything like n^2.
But what if the running time is defined by multiple variable function, e.g O(V*E) in many graph algorithms.
How should I approach this?
It's possible to plot two different graphs of O(V*E). one assuming that E is constant, second assuming that V is constant. But that won't compare the practical time of O(V*E), or will it?
Thanks in advance.
I was given an assignment by my teacher to implement some algorithm and analyze its practical running time versus theoretical.
With algorithms running in O(n^2) it's seems to be rather simple. Get execution times for different inputs. Plot on a graph and check if the plotted function behaves anything like n^2.
But what if the running time is defined by multiple variable function, e.g O(V*E) in many graph algorithms.
How should I approach this?
It's possible to plot two different graphs of O(V*E). one assuming that E is constant, second assuming that V is constant. But that won't compare the practical time of O(V*E), or will it?
Thanks in advance.