Perbandingan Algoritma Greedy dan Dynamic Programming pada Penyelesaian Knapsack Problem untuk Optimasi Pemilihan Barang

Authors

  • Khairany Zuhriyyah Jinan Hsb Universitas Negeri Medan
  • Augis Dinanti Universitas Negeri Medan
  • Muhammad Iqbal fahrezzi Universitas Negeri Medan
  • Arion Pardede Universitas Negeri Medan
  • Adidtya Perdana Universitas Negeri Medan

DOI:

https://doi.org/10.51903/teknik.v6i1.1127

Keywords:

Algoritma Greedy; Analisis Performa; Dynamic Programming; Knapsack Problem; Optimasi.

Abstract

Optimization problems in computer science often arise when a system must select the best combination from several alternatives under limited resources such as capacity, time, or cost. One commonly used optimization model is the Knapsack Problem, which involves selecting a number of items with specific weights and values to obtain the maximum profit without exceeding the available capacity. This study aims to analyze and compare the performance of the Greedy algorithm and Dynamic Programming in solving the 0–1 Knapsack Problem. The research employs a quantitative experimental approach by implementing both algorithms in a computer program and testing them on several datasets with different sizes. The evaluation parameters include the maximum value obtained and the algorithm execution time. The results show that the Greedy algorithm has faster execution time and more efficient memory usage, but it does not always produce an optimal solution. In contrast, the Dynamic Programming algorithm consistently produces an optimal solution, although it requires greater computational time. Therefore, the choice of algorithm should be adjusted to system requirements, whether prioritizing computational efficiency or optimal solution quality.

Downloads

Published

2026-05-02

How to Cite

Perbandingan Algoritma Greedy dan Dynamic Programming pada Penyelesaian Knapsack Problem untuk Optimasi Pemilihan Barang. (2026). Teknik: Jurnal Ilmu Teknik Dan Informatika, 6(1), 29-44. https://doi.org/10.51903/teknik.v6i1.1127