Spotify provides audio metadata that can be utilized to support physical activities such as jogging. This study compares the performance of Greedy and Dynamic Programming algorithms for Spotify playlist optimization modeled as a 0/1 Knapsack Problem. Song duration is treated as weight, while a score derived from popularity and energy is used as value. The dataset was obtained from Spotify Wrapped 2025 Top 50 Songs and Spotify All-Time Top 100 Songs, resulting in 31 candidate songs after preprocessing and filtering. Experiments were conducted on playlist durations of 30, 45, 60, 75, and 90 minutes. The results show that Dynamic Programming consistently achieved higher total scores than Greedy across all scenarios. For the 60-minute playlist, Dynamic Programming obtained a total score of 1897 compared to 1894 achieved by Greedy. However, Greedy required a lower execution time (4.244 ms) than Dynamic Programming (16.196 ms). The average optimality gap between the two methods was 1.89%, indicating that Greedy produced solutions that were close to the optimal solutions generated by Dynamic Programming while requiring less computation time.
Copyrights © 2026