Analysis of Complexity of Some CombinatorialAlgorithms Using Halstead Metrics and Time Measures

The Knapsack problem is a combinatorial optimization problem for which finding an exact solutionusing exhaustive search methods is impractical. Therefore, approximate algorithms are usually considered whentackling this optimization problem. The goal of this study was to analyze the complexity of the Knapsack problemusing three approximate algorithms: greedy, dynamic programming, and branch-and-bound methods. To achievethis, we measured the Halstead metrics and computational time complexity of these three algorithms. Ourmethodology involved solving a hypothetical Knapsack problem using the three algorithms in the sameprogramming environment. Experiments were conducted with varying input datasets, and the time complexities ofthe algorithms were recorded for each experiment. The average time complexities were computed at the end of theexperiments. Additionally, we calculated the Halstead metrics required for the study. Both the Halstead metrics andcomputational time metrics for the three algorithms were then compared. Our findings showed that the greedyapproach was the most efficient heuristic, followed closely by the dynamic programming method, with the branch-and-bound algorithm being the least efficient. Future work will incorporate real-world data with specific itemcharacteristics to enhance the relevance and applicability of the findings. Additionally, it will explore hybridapproaches that combine these algorithms to leverage their respective strengths and effectively address theirweaknesses.

Publication Details

Journal
Figshare
Published
2024-10-25
DOI
https://doi.org/10.6084/m9.figshare.27301824
Primary Topic
Optimization and Packing Problems
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Analysis of Complexity of Some CombinatorialAlgorithms Using Halstead Metrics and Time Measures

Figshare
Optimization and Packing Problems
article

Analysis of Complexity of Some CombinatorialAlgorithms Using Halstead Metrics and Time Measures

article en

Abstract

The Knapsack problem is a combinatorial optimization problem for which finding an exact solutionusing exhaustive search methods is impractical. Therefore, approximate algorithms are usually considered whentackling this optimization problem. The goal of this study was to analyze the complexity of the Knapsack problemusing three approximate algorithms: greedy, dynamic programming, and branch-and-bound methods. To achievethis, we measured the Halstead metrics and computational time complexity of these three algorithms. Ourmethodology involved solving a hypothetical Knapsack problem using the three algorithms in the sameprogramming environment. Experiments were conducted with varying input datasets, and the time complexities ofthe algorithms were recorded for each experiment. The average time complexities were computed at the end of theexperiments. Additionally, we calculated the Halstead metrics required for the study. Both the Halstead metrics andcomputational time metrics for the three algorithms were then compared. Our findings showed that the greedyapproach was the most efficient heuristic, followed closely by the dynamic programming method, with the branch-and-bound algorithm being the least efficient. Future work will incorporate real-world data with specific itemcharacteristics to enhance the relevance and applicability of the findings. Additionally, it will explore hybridapproaches that combine these algorithms to leverage their respective strengths and effectively address theirweaknesses.

Figshare
Openalex Percentile: Top 50%
Optimization and Packing Problems
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Analysis of Complexity of Some CombinatorialAlgorithms Using Halstead Metrics and Time Measures · Figshare (2024) | TGRS Research Map | TGRS