Login

Create Account
+14156709189
info@expertsmind.com
Submit Homework/Assignment
Get quote & make Payment
Get Solution
Small program on Algorithms , Data Structure & Algorithms
Objective
The goal of this project is to extend and implement an algorithm presented in the course and to apply notions introduced by the course to this program/algorithm. The assignment is relatively openended. The instructor will answer any question you may have. However, when in doubt, work toward the project goal stated above. This is an individual project. You may discuss it with other students, but the work you present must be your own only.
Deliverable
You will produce two items: (1) the code of the program specified below, and (2) a narrative of your work specified below. You will email both items to the TA (whose address will become available in the syllabus early in the course). The items will be transmitted as attachments to your email. The code will be formatted as ASCII text. The narrative will be formatted as either ASCII text or PDF. The deadline follows the rules of the homework, the beginning of the first lecture of the week following the assignment, except that you will email the material rather than bringing a hard copy to class. Late submission will be accepted up to 3 days and will be penalized at 10% a day.
Code spec
Your code will extend and implement the Knapsack Problem as presented in Section 8.2 of the textbook. The extension will become clear while describing the output. Your program is expected to read a file called "input2.txt" containing 3*k lines, li,j for i in 1,2,... k and j in 1,2,3. An example of input file is input2.txt. For any i, line li,1 contains n positive integers separated by a comma. They are the weights W1,W2,... of a Knapsack Problem instance with n items, where n is less than 100. Likewise, line li,2 contains n positive integers separated by a comma. They are the values V1,V2,... of the items whose weights are in the previous line. Finally, line li,3 contains a single integer, the knapsack capacity. No other characters beside digits and commas are in each line.
Your program is expected to write a file called "output2.txt" containing 5*k lines, mi,j for i in 1,2,... k and j in 1,2,...5. The output file corresponding to input2.txt is output2.txt. For i in 1,2,... k and j in 1,2,3, mi,j=li,j. Line mi,4 contains a single integer, the Knapsack Problem instance optimal solution. Line mi,5 contains a sequence of positive integers in increasing values. They are the indexes, starting with 1, of the items that make up an optimal solution. The general format of the output is the same as the format of the input. The extension with respect to the textbook algorithm is the generation of a set of items witnessing an optimal solution. If there is more than one set, any set is acceptable.
The weights, values, capacities and other parameters will be within reasonable ranges for a modern laptop or desktop. The programming language can be any of Java, Python, Ruby, C, and C++. Deliver all your code in a single file that can be compiled and executed on cs.pdx.edu. Your program should perform reasonably efficiently both in theory and in practice.
Narrative spec
The narrative is intended to show that you know and understand the aspects of the project related to this course, in particular, ability to: (1) extend and implement an algorithms, (2) relate theoretical complexity to practice, (3) code correct, readable and efficient programs, and (4) communicate your work clearly and concisely.
I would expect to find one or more of the following: (1) a description of the extension in the same style as the algorithm in the textbook, (2) a description of key data structures and algorithms used in the program, (3) the running time analysis of your algorithm/program, and (4) any benchmarking, profiling and/or testing employed for development.
Hints
You are encouraged to start your work early. Reading and writing the files are tasks that you already partially solved in Project 1. The Knapsack Problem is very easy to understand. Initially, you can implement a brute force program without computing the indexes. This will work for small problem instances. Then, you can replace the brute force approach with the dynamic programming approach presented in the textbook. Finally, you can introduce the extension. As the code evolves, you can use the previous version to test the current version''s correctness.
Posted Date: 10/30/2012 10:22:25 PM  Location : United States
Ask an Expert
Related Discussions:
Small program on Algorithms , Assignment Help, Ask Question on Small program on Algorithms , Get Answer, Expert's Help, Small program on Algorithms Discussions
Write discussion on Small program on Algorithms
Your posts are moderated
Write your message here..
Related Questions
State zbuffer algorithm, ZBuffer Algorithm Also known as the DepthBu...
ZBuffer Algorithm Also known as the DepthBuffer algorithm, this imagespace method simply selects forĀ display the polygon or portion of a polygon that is nearest to the view
Explain the prim''s minimum spanning tree algorithm, Question 1. Explai...
Question 1. Explain the different types of traversal on binary tree 2. Explain the Prim's minimum spanning tree algorithm 3. Differentiate fixed and variable storage allo
Binary search, An unsorted array is searched through linear search that sca...
An unsorted array is searched through linear search that scans the array elements one by one until the wanted element is found. The cause for sorting an array is that we search
Endogenous model, Question a) Describe how the endogenous model is an ...
Question a) Describe how the endogenous model is an improvement to the neoclassical model in explaining the longrun effect of investment on economic growth of a country.
Frequency count, what is frequency count with examble? examble?
what is frequency count with examble? examble?
Write a program for linear search, In the book the following methods are pr...
In the book the following methods are presented: static void selectionSort(Comparable[] list) static void insertionSort(Comparable[] list) static boolean linearSearch(Comparable
Describe data structure?, Typical programming languages such as Pascal, C o...
Typical programming languages such as Pascal, C or Java give primitive data kinds such as integers, boolean, reals values and strings. They give these to be organised into arrays,
HASHING, MID SQUARE METHOD
MID SQUARE METHOD
Algorithm that inputs the codes for all items in stock, A shop sells books,...
A shop sells books, magazines and maps. Every item is identified by a unique 4  digit code. All books have a code which starts with 1, all maps have a code starting with 2 and all
Define strictly binary tree, Define Strictly Binary Tree Strictly Bina...
Define Strictly Binary Tree Strictly Binary Tree:  If each non leaf node in binary tree has non empty left and right subtrees , then the tree is known as a strictly binary t
Assignment Help
Accounting Assignment Help
Economics Assignment Help
Finance Assignment Help
Statistics Assignment Help
Physics Assignment Help
Chemistry Assignment Help
Math Assignment Help
Biology Assignment Help
English Assignment Help
Management Assignment Help
Engineering Assignment Help
Programming Assignment Help
Computer Science Assignment Help
IT Courses and Help
ExpertsMind Services
Online Tutoring
Projects Assistance
Exam Preparation
Coursework Help
Programming Courses
Engineering Courses
Why Us ?
~Experienced Tutors
~24x7 hrs Support
~Plagiarism Free
~Quality of Work
~Time on Delivery
~Privacy of Work