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

Jukka K. Nurminen

Research output: Contribution to journalArticleScientificpeer-review

12 Citations (Scopus)

Abstract

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. For practical use an algorithm has to be fast and accurate as well as easy to implement, test, and maintain. In this work, we investigate whether software complexity measures could make the implementation aspects more explicit and allow algorithm comparisons also in this dimension. We calculate lines-of-code, Halstead's volume, and cyclomatic number measures for different shortest-path algorithms. We investigate if such measures are applicable to algorithm comparison and study what can be learned from algorithms when they are also compared in implementation dimension. The main purpose of the work is to understand if it is possible to explicitly measure the implementation complexity of an algorithm. Having such measures available would help the practitioner to choose the algorithm that best matches the need. The optimal algorithm for a given task would have adequate performance with minimal implementation complexity. For algorithm research implementation, complexity measures would offer a new analysis dimension and make easy implementation a parallel goal with algorithm performance. © 2002 Elsevier Science Ltd. All rights reserved.
Original languageEnglish
Pages (from-to)1121-1134
JournalComputers and Operations Research
Volume30
Issue number8
DOIs
Publication statusPublished - Jul 2003
MoE publication typeA1 Journal article-refereed

Fingerprint

Shortest Path Algorithm
Complexity Measure
Software
Experiment
Experiments
Shortest path
Line
Calculate
Optimal Algorithm
Correlate
Fast Algorithm

Keywords

  • Algorithm implementation
  • Shortest-path algorithms
  • Software complexity measures

Cite this

@article{fa99fe89e519455c9be52e5874d5d4f7,
title = "Using software complexity measures to analyze algorithms: An experiment with the shortest-paths algorithms",
abstract = "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. For practical use an algorithm has to be fast and accurate as well as easy to implement, test, and maintain. In this work, we investigate whether software complexity measures could make the implementation aspects more explicit and allow algorithm comparisons also in this dimension. We calculate lines-of-code, Halstead's volume, and cyclomatic number measures for different shortest-path algorithms. We investigate if such measures are applicable to algorithm comparison and study what can be learned from algorithms when they are also compared in implementation dimension. The main purpose of the work is to understand if it is possible to explicitly measure the implementation complexity of an algorithm. Having such measures available would help the practitioner to choose the algorithm that best matches the need. The optimal algorithm for a given task would have adequate performance with minimal implementation complexity. For algorithm research implementation, complexity measures would offer a new analysis dimension and make easy implementation a parallel goal with algorithm performance. {\circledC} 2002 Elsevier Science Ltd. All rights reserved.",
keywords = "Algorithm implementation, Shortest-path algorithms, Software complexity measures",
author = "Nurminen, {Jukka K.}",
year = "2003",
month = "7",
doi = "10.1016/S0305-0548(02)00060-6",
language = "English",
volume = "30",
pages = "1121--1134",
journal = "Computers and Operations Research",
issn = "0305-0548",
publisher = "Pergamon Press",
number = "8",

}

Using software complexity measures to analyze algorithms : An experiment with the shortest-paths algorithms. / Nurminen, Jukka K.

In: Computers and Operations Research, Vol. 30, No. 8, 07.2003, p. 1121-1134.

Research output: Contribution to journalArticleScientificpeer-review

TY - JOUR

T1 - Using software complexity measures to analyze algorithms

T2 - An experiment with the shortest-paths algorithms

AU - Nurminen, Jukka K.

PY - 2003/7

Y1 - 2003/7

N2 - 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. For practical use an algorithm has to be fast and accurate as well as easy to implement, test, and maintain. In this work, we investigate whether software complexity measures could make the implementation aspects more explicit and allow algorithm comparisons also in this dimension. We calculate lines-of-code, Halstead's volume, and cyclomatic number measures for different shortest-path algorithms. We investigate if such measures are applicable to algorithm comparison and study what can be learned from algorithms when they are also compared in implementation dimension. The main purpose of the work is to understand if it is possible to explicitly measure the implementation complexity of an algorithm. Having such measures available would help the practitioner to choose the algorithm that best matches the need. The optimal algorithm for a given task would have adequate performance with minimal implementation complexity. For algorithm research implementation, complexity measures would offer a new analysis dimension and make easy implementation a parallel goal with algorithm performance. © 2002 Elsevier Science Ltd. All rights reserved.

AB - 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. For practical use an algorithm has to be fast and accurate as well as easy to implement, test, and maintain. In this work, we investigate whether software complexity measures could make the implementation aspects more explicit and allow algorithm comparisons also in this dimension. We calculate lines-of-code, Halstead's volume, and cyclomatic number measures for different shortest-path algorithms. We investigate if such measures are applicable to algorithm comparison and study what can be learned from algorithms when they are also compared in implementation dimension. The main purpose of the work is to understand if it is possible to explicitly measure the implementation complexity of an algorithm. Having such measures available would help the practitioner to choose the algorithm that best matches the need. The optimal algorithm for a given task would have adequate performance with minimal implementation complexity. For algorithm research implementation, complexity measures would offer a new analysis dimension and make easy implementation a parallel goal with algorithm performance. © 2002 Elsevier Science Ltd. All rights reserved.

KW - Algorithm implementation

KW - Shortest-path algorithms

KW - Software complexity measures

U2 - 10.1016/S0305-0548(02)00060-6

DO - 10.1016/S0305-0548(02)00060-6

M3 - Article

VL - 30

SP - 1121

EP - 1134

JO - Computers and Operations Research

JF - Computers and Operations Research

SN - 0305-0548

IS - 8

ER -