The Knapsack problem


PART 1 The Knapsack problem (BKP) is a problem in combinatorial optimization. This problem is described as follows: Given a list of items, each item has a weight and a benefit, determine the number of each item to include in a bag so that the total weight is less or equal to the limit of the bag and we get the maximum benefit. The most common problem to solve is the 0-1 knapsack problem, which restricts the number of copies of an item to one. Therefore, an item can be inside the bag or outside. We now consider the problem with a set of items (you can find the document in canvas with the name “assignment 1 knapsack.txt”).These items are represented by 2 values (weight and benefit) as illustrated in the table below.

What to do: Your assignment now is to apply Breadth-first search (BFS) and Depth-first search (DFS) to search for the best combination of items inside the bag. Remember, only one copy of an item. You need to use a tree (queue or stack depending of the algorithm) and nodes in order to implement both search strategies. You need to present both codes to the teacher. (0.5 points each code).

Pre-conditions in order to present your code:

– The codes should run faster than 0.5 seconds. If you cannot get it faster, talk to the teacher. The reason could be your computer.

– You must use queue or stack, depending of the algorithm (or simulate them using an array).

Calculate the price of your order

Simple Order Process

Fill in the Order Form

Share all the assignment information. Including the instructions, provided reading materials, grading rubric, number of pages, the required formatting, deadline, and your academic level. Provide any information and announcements shared by the professor. Choose your preferred writer if you have one.

Get Your Order Assigned

Once we receive your order form, we will select the best writer from our pool of experts to fit your assignment.

Share More Data if Needed

You will receive a confirmation email when a writer has been assigned your task. The writer may contact you if they need any additional information or clarifications regarding your task

Let Our Essay Writer Do Their Job

Once you entrust us with your academic task, our skilled writers embark on creating your paper entirely from the ground up. Through rigorous research and unwavering commitment to your guidelines, our experts meticulously craft every aspect of your paper. Our process ensures that your essay is not only original but also aligned with your specific requirements, making certain that the final piece surpasses your expectations.

Quality Checks and Proofreading

Upon the completion of your paper, it undergoes a meticulous review by our dedicated Quality and Proofreading department. This crucial step ensures not only the originality of the content but also its alignment with the highest academic standards. Our seasoned experts conduct thorough checks, meticulously examining every facet of your paper, including grammar, structure, coherence, and proper citation. This comprehensive review process guarantees that the final product you receive not only meets our stringent quality benchmarks but also reflects your dedication to academic excellence.

Review and Download the Final Draft

If you find that any part of the paper does not meet the initial instructions, send it back to us with your feedback, and we will make the necessary adjustments.