Volume 7, Issue 2, February – 2022 International Journal of Innovative Science and Research Technology ISSN No:-2456-2165 IJISRT22FEB088 www.ijisrt.com 660 An Explanatory Comparison of Brute Force and Dynamic Programming Techniques to Solve the 0-1 Knapsack Problem O.A Balogun 1 M.A Dosunmu 2 I.O Ibidapo 2 1,2 Department of Computer Science and Information Technology, Bells University of Technology, Ota, Ogun State, Nigeria. Abstract:- During examination periods in schools, the demand on the use of examination rooms usually increases thus necessitating an optimal allocation of such rooms. This work seeks to explore an optimal way of allocating examination rooms by modeling the problem as a 0-1 Knapsack problem. Two approaches namely the Brute force and Dynamic programming techniques are used and implemented in Excel® and NetBeans® environments. The obtained results showed that dynamic programming approach yields a more optimal result than the Brute force implementation. Keywords:- Knapsack, Dynamic Algorithm, Brute Force. I. INTRODUCTION In nature, getting a result from a process involves usually a series of steps. In some cases, some steps are repeated while others occur once. These steps, also known as algorithms have been studied extensively by computer scientists and have helped to frame modern day computing and its related technologies. [14] suggests that we think of an algorithm as a recipe that describes the exact steps needed for a computer to solve a problem or reach a goal. In other words, it can be defined as a detailed step-by-step method for solving a problem by using a computer or a sequence of unambiguous instructions for solving a problem in a finite amount of time. A major part of human existence is the idea of getting the most value based on a limit at the smallest cost. An example is a person going shopping for clothes. Naturally, the person wants to get high quality clothes at the best possible cost. This situation is called a Knapsack problem in computer science and have been studied extensively and applied to solve problems in the Financial, Manufacturing, and other industries at large. The efficiency of an algorithm is measured with respect to the time required execute it and the amount of computational space used. Algorithms can also be sorted into sequential, parallel, and exact and approximate algorithms. Usually, in solving robust computing problems (problems that are dynamic in nature), there is usually more than a correct solution. This helps us to pick the most favourable solution (an optimal solution), with respect to time and space, that makes use of lesser resources and gives maximum output gain with respect to time and space. Dynamic programming is a well-suited technique for optimization problems because it solves problems by combining solutions of solved sub-problems. According to [8], Brute force algorithm, on the other hand, is a type of algorithm that tries a large number of patterns to solve a problem and rely on raw computing power to achieve this in some cases. Within every educational system, a period to test the knowledge of students based on what they have been taught must occur. In most formal educational setting, this period usually comes after rigorous class sessions. Not all citadels of learning have the structural resources to accommodate a combination of the number of students that can sit for different courses within the same time period. This work aims to find an optimal solution to this problem. In this work, the data was modelled like that of typical University with a limited number of halls which invariably elongates the examination period. Given the number of courses that a typical university runs, this works uses Brute force and Dynamic programming techniques to find an optimal solution to a 0-1 knapsack problem in the configuration of number of students that can make use of a particular hall at the same time. In the 0-1 knapsack problem, each item (in this case, all students sitting for a particular course) must be put entirely in the knapsack or not included at all, hence, the 0-1 connotation. The number of resources is limited to one hall because of the weight constraint of the knapsack problem. For the purpose of this work, we name this hall Main Hall. II. LITERATURE REVIEW Algorithms help us put computational and resources requirement for solving a problem in the right perspective. Various works like [2] and [5] discuss the strength and weaknesses of algorithms which ultimately influence choice. Generally, factors that influence an algorithm’s choice are the number of items to be worked on, the type of algorithimic activity that would be carried out on such items, restrictions on the items, and the kind of storage device that would be used. [1] posits that rather than solving overlapping subproblems repeatedly, dynamic programming suggests solving each of the smaller sub problems only once and