Question: General Description For this assignment you will implement two algorithms to the BUDGETED PURCHASE problem. The first algorithm is to use iterative deepening, using the
General Description
For this assignment you will implement two algorithms to the BUDGETED PURCHASE problem.
The first algorithm is to use iterative deepening, using the state space described in problem set problem
The second algorithm is to use the hill climbing method described in problem set problem together with random restart. To create a random starting point, just go through the objects and assign each one to be in or out of the state, with probability
Input
The input is a plain text file.
For the iterative deepening program, the first line is the target value and the budget, as integers, followed by a flag for the type of output: V for verbose or C for compact.
For the hill climbing program, the first line has additionally the number of restarts to try.
Each subsequent line has an object name an alphabetic character string and value and cost as integers.
For instance, one possible input for iterative deepening would be this: the input would be
V
U
V
W
X
Y
For hill climbing it would be the same, except that the first lie would be V if you were doing three random restarts.
Output
Compact output is just the names of the objects in the solution separated by spaces; or No Solution" if no solution is found.
Verbose output shows a trace of the search, in the forms illustrated below for the above input.
Iterative deepening
Depth
U Value Cost
V Value Cost
W Value Cost
X Value Cost
Z Value Cost
Depth
U Value Cost
U Z Value Cost
V Value Cost
V W Value Cost
V X Value Cost
V Z Value Cost
W Value Cost
W X Value Cost
W Z Value Cost
X Value Cost
X Z Value Cost
Z Value Cost
Depth
U Value Cost
U Z Value Cost
V Value Cost
V W Value Cost
V W X Value Cost
Found solution V W X Value Cost
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
