Solving 0-1 Knapsack Problems by Greedy Method and Dynamic Programming Method

2011 ◽  
Vol 282-283 ◽  
pp. 570-573
Author(s):  
Lu Liu

The 0-1 knapsack problem is typical problem in computer science and its solution is a hot spot in algorithms design and verification. Because it is very hard to solve, it is very important in the research on cryptosystem and number theory. In this paper, the 0-1 knapsack problem and its algorithm is analyzed firstly. And then this paper presents two kinds of expand form, and proposes two efficient algorithms based on dynamic programming and greedy algorithm to solve the proposed problems. Simulation results show it is effective.

2018 ◽  
Vol 5 (1) ◽  
pp. 49 ◽  
Author(s):  
Global Ilham Sampurno ◽  
Endang Sugiharti ◽  
Alamsyah Alamsyah

At this time the delivery of goods to be familiar because the use of delivery of goods services greatly facilitate customers. PT Post Indonesia is one of the delivery of goods. On the delivery of goods, we often encounter the selection of goods which entered first into the transportation and  held from the delivery. At the time of the selection, there are Knapsack problems that require optimal selection of solutions. Knapsack is a place used as a means of storing or inserting an object. The purpose of this research is to know how to get optimal solution result in solving Integer Knapsack problem on freight transportation by using Dynamic Programming Algorithm and Greedy Algorithm at PT Post Indonesia Semarang. This also knowing the results of the implementation of Greedy Algorithm with Dynamic Programming Algorithm on Integer Knapsack problems on the selection of goods transport in PT Post Indonesia Semarang by applying on the mobile application. The results of this research are made from the results obtained by the Dynamic Programming Algorithm with total weight 5022 kg in 7 days. While the calculation result obtained by Greedy Algorithm, that is total weight of delivery equal to 4496 kg in 7 days. It can be concluded that the calculation results obtained by Dynamic Programming Algorithm in 7 days has a total weight of 526 kg is greater when compared with Greedy Algorithm.


Author(s):  
Daniele Catanzaro ◽  
Stefano Coniglio ◽  
Fabio Furini

AbstractWe investigate the problem of separating cover inequalities of maximum-depth exactly. We propose a pseudopolynomial-time dynamic-programming algorithm for its solution, thanks to which we show that this problem is weakly $${\mathcal {N}}{\mathcal {P}}$$ N P -hard (similarly to the problem of separating cover inequalities of maximum violation). We carry out extensive computational experiments on instances of the knapsack and the multi-dimensional knapsack problems with and without conflict constraints. The results show that, with a cutting-plane generation method based on the maximum-depth criterion, we can optimize over the cover-inequality closure by generating a number of cuts smaller than when adopting the standard maximum-violation criterion. We also introduce the Point-to-Hyperplane Distance Knapsack Problem (PHD-KP), a problem closely related to the separation problem for maximum-depth cover inequalities, and show how the proposed dynamic programming algorithm can be adapted for effectively solving the PHD-KP as well.


2010 ◽  
Vol 143-144 ◽  
pp. 166-171 ◽  
Author(s):  
Qiao Qiao Gong ◽  
Yong Quan Zhou ◽  
Yan Yang

In this paper, an artificial glowworm swarm optimization algorithm for solving 0-1 knapsack problem is proposed, and the detailed realization of the algorithm is illustrated. According to intelligent algorithm for knapsack problem, the question of sensitive parameter’s choice is avoided under the greed idea. Simulation results show that the artificial glowworm swarm optimization algorithm for solving 0-1 knapsack problems is feasible and effective.


2019 ◽  
Vol 71 (3) ◽  
pp. 40 ◽  
Author(s):  
Yurii V. Horoshko ◽  
Oleksandr V. Mitsa ◽  
Valentyn I. Melnyk

The article analyzes the peculiarities of the Olympiad tasks on computer science: distracting story, placing various important components of the problem in different places of the condition, non-standard mathematical models, non-standard combination of standard approaches, etc. Taking this into account, as well as the rather high complexity of such tasks, there is the problem of working out methodological approaches to teaching to solve such problems. The general schemes of solving the Olympiad tasks on computer science, proposed by various scientists participating in the Olympiad movement, are considered. Based on the own experience, one of them has been selected. One of the areas of dynamic programming, the so-called Knapsack Problems, is considered. There are given various modifications of Knapsack Problem; the ability to solve them is necessary to understand the solution of a more complex task related to dynamic programming. For these tasks are given appropriate mathematical formulas or program code. There are presented all stages of the application of the given scheme to the solving of a specific Olympiad task on computer science, which belongs to the class of Knapsack Problems and proposed by one of the authors at the Open International Student Programming Olympiad “KPI-OPEN 2017” named after S.O. Lebediev and V.M. Glushkov “KPI-OPEN 2017”: the analysis of the condition, the construction of a mathematical model, the construction of a general scheme of solving, refinement, implementation, testing and debugging, sending the program to check. An effective author’s method for solving this task is demonstrated. The program code for the solution is given in C++. It is noted that the important point in preparing for the Olympiads on computer science is the analysis of the tasks after the completion of each competition. Applying the proposed methodological approaches to training pupils or students for the Olympiads on computer science (programming), in our opinion, will increase the effectiveness of such training.


2015 ◽  
Vol 18 (1) ◽  
pp. 258-265 ◽  
Author(s):  
Jennifer S. Balakrishnan

The Coleman integral is a $p$-adic line integral that encapsulates various quantities of number theoretic interest. Building on the work of Harrison [J. Symbolic Comput. 47 (2012) no. 1, 89–101], we extend the Coleman integration algorithms in Balakrishnan et al. [Algorithmic number theory, Lecture Notes in Computer Science 6197 (Springer, 2010) 16–31] and Balakrishnan [ANTS-X: Proceedings of the Tenth Algorithmic Number Theory Symposium, Open Book Series 1 (Mathematical Sciences Publishers, 2013) 41–61] to even-degree models of hyperelliptic curves. We illustrate our methods with numerical examples computed in Sage.


2021 ◽  
Vol 13 (15) ◽  
pp. 8271
Author(s):  
Yaqing Xu ◽  
Jiang Zhang ◽  
Zihao Chen ◽  
Yihua Wei

Although there are highly discrete stochastic demands in practical supply chain problems, they are seldom considered in the research on supply chain systems, especially the single-manufacturer multi-retailer supply chain systems. There are no significant differences between continuous and discrete demand supply chain models, but the solutions for discrete random demand models are more challenging and difficult. This paper studies a supply chain system of a single manufacturer and multiple retailers with discrete stochastic demands. Each retailer faces a random discrete demand, and the manufacturer utilizes different wholesale prices to influence each retailer’s ordering decision. Both Make-To-Order and Make-To-Stock scenarios are considered. For each scenario, the corresponding Stackelberg game model is constructed respectively. By proving a series of theorems, we transfer the solution of the game model into non-linear integer programming model, which can be easily solved by a dynamic programming method. However, with the increase in the number of retailers and the production capacity of manufacturers, the computational complexity of dynamic programming drastically increases due to the Dimension Barrier. Therefore, the Fast Fourier Transform (FFT) approach is introduced, which significantly reduces the computational complexity of solving the supply chain model.


Sign in / Sign up

Export Citation Format

Share Document