Using software complexity measures to analyze algorithms - an experiment with the shortest-paths algorithms

In this paper, we apply different software complexity measures to a set of shortest-path algorithms. Our intention is to study what kind of new information about the algorithms the complexity measures (lines-of-code, Halstead's volume, and cyclomatic number) are able to give, to study which software complexity measures are the most useful ones in algorithm comparison, and to analyze when the software complexity comparisons are appropriate. The experiment indicates that the software complexity measures give a new dimension to empirical algorithm comparison. The results explicitly show the trade-off between speed and implementation complexity: a faster algorithm typically requires a more complex implementation. Different complexity measures correlate strongly. Therefore, even the simple lines-of-code measure gives useful results. As the software complexity measures are easy to calculate and since they give useful information, the study suggests that such measures should be included in empirical algorithm comparisons. Unfortunately, for meaningful results, all the algorithms have to be developed in the same fashion which makes the comparison of independent implementations difficult.

[1]  Jukka K. Nurminen,et al.  Case study of the evolution of routing algorithms in a network planning tool , 2001, J. Syst. Softw..

[2]  Maurice H. Halstead,et al.  Elements of software science (Operating and programming systems series) , 1977 .

[3]  Paul W. Oman,et al.  Development and Application of an Automated Source Code Maintainability Index , 1997, J. Softw. Maintenance Res. Pract..

[4]  Jeremy G. Siek,et al.  The generic graph component library , 1999, OOPSLA '99.

[5]  Robert Sedgewick,et al.  Algorithms in C , 1990 .

[6]  Anas N. Al-Rabadi,et al.  A comparison of modified reconstructability analysis and Ashenhurst‐Curtis decomposition of Boolean functions , 2004 .

[7]  Michael O. Ball,et al.  The design and analysis of heuristics , 1981, Networks.

[8]  Maurice H. Halstead,et al.  Elements of software science , 1977 .

[9]  Ravindra K. Ahuja,et al.  Network Flows: Theory, Algorithms, and Applications , 1993 .

[10]  Jeremy G. Siek,et al.  The Generic Graph Component Library (GGCL) User Manual , 2000 .

[11]  John Stephen Davis,et al.  A Study of the Applicability of Complexity Measures , 1988, IEEE Trans. Software Eng..

[12]  M. Shepperd,et al.  A critique of cyclomatic complexity as a software metric , 1988, Softw. Eng. J..

[13]  John C. Munson,et al.  Software evolution: code delta and code churn , 2000, J. Syst. Softw..

[14]  Andrew V. Goldberg,et al.  Shortest paths algorithms: Theory and experimental evaluation , 1994, SODA '94.

[15]  Chris F. Kemerer,et al.  Cyclomatic Complexity Density and Software Maintenance Productivity , 1991, IEEE Trans. Software Eng..