NobleBlocks

Research indexJournal article

Точний метод розв'язання задачі про суму підмножини з прискоренням на графічному процесорі

Lenskyi, Mykhalchuk

Actual problems of automation and information technology29 Dec 2023Open access

NobleIDark:/48914/w1/20260525/64232787DOI10.15421/432313

Abstract

The Subset Sum Problem (SSP) is one of the classical NP-complete problems that has many applications in various fields of science and technology. The problem is that for a given set of integers, it is needed to determine whether there exists a subset whose sum of elements is equal to a given target number. The Subset Sum Problem is an NP-complete problem, therefore the most known algorithms for its solution have exponential complexity in the general case. In this paper, an exact algorithm for solving the Subset Sum Problem based on backtracking, which utilizes GPU to speed up computations, is proposed. The algorithm discards a path if the partial sum exceeds the target value or if the sum of the current subset and the maximum possible sum left is less than the target value. These pruning criteria enable the removal of significant parts of the search space that do not have a feasible solution. The algorithm employs a CPU-based Breadth-First Search (BFS) followed by a GPU-accelerated Depth-First Search (DFS) to achieve efficient exploration within the given search space. The BFS phase terminates when a predefined depth limit is reached, when the queue becomes empty (indicating no further expansion), or when a solution satisfying the desired criteria is identified. The data is stored in a queue, facilitating efficient retrieval and processing. The DFS phase, executed on the GPU, leverages the results obtained from the BFS phase. It further explores promising candidates identified by BFS, utilizing pruning techniques to refine the search and reach solutions. At this phase data is stored in stack. The paper demonstrates that the developed algorithm achieves a significant reduction in execution time compared to the CPU implementation. The algorithm is also tested on different numbers of GPU threads and on different instances.

Discussion

Citations

Topics

More

Suggest a correction or report