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 1, problem 1.
The second algorithm is to use the hill climbing method described in problem set 2, problem 1, 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 1/2.
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
2010 V
U 108
V 84
W 73
X 63
Y 41
For hill climbing it would be the same, except that the first lie would be 2010 V 3 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 =1.
{U}. Value =10. Cost =8.
{V}. Value =8. Cost =4.
{W}. Value =7. Cost =3.
{X}. Value =6. Cost =3.
{Z}. Value =4. Cost =1.
Depth =2
{U}. Value =10. Cost =8.
{U Z}. Value =14. Cost =9.
{V}. Value =8. Cost =4.
{V W}. Value =15. Cost =7.
{V X}. Value =14. Cost =7.
{V Z}. Value =12. Cost =5.
{W}. Value =7. Cost =3.
{W X}. Value =13. Cost =7.
{W Z}. Value =11. Cost =4.
{X}. Value =6. Cost =3.
{X Z}. Value =10. Cost =4.
{Z}. Value =4. Cost =1.
Depth =3
{U}. Value =10. Cost =8.
{U Z}. Value =14. Cost =9.
{V}. Value =8. Cost =4.
{V W}. Value =15. Cost =7.
{V W X}. Value =21. Cost =10.
Found solution {V W X}. Value =21. Cost =10.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!