Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

Recap:

What is a search space?

a) The set of all possible solutions to a problem.


b) The memory needed to store the search algorithm.
c) The steps taken by the algorithm to solve the problem.
d) The data structures used to represent the problem.
Recap:
Which algorithm typically uses a closed list to avoid revisiting states?

a) Tree search
b) Graph search
c) Binary search
d) Random search
Recap:
Which algorithm is more likely to encounter issues with cycles in the
search space?

a) Tree search
b) Graph search
c) Binary search
d) Random search
Recap:
Which algorithm is more likely to encounter memory storage issues?

a) Tree search
b) Graph search
c) Binary search
d) Random search
Algorithm:
Random Search

At each step, the next node is determined at random.


We cannot guarantee to reach the target node, or even if we can
reach the target, the path so obtained is very redundant.
Example:
Step Current Success Expanded Randomly
variable status list chosen
variable
Advantages of Random Search:
• Simple and easy to implement: Requires minimal code and works
across diverse problem domains.
• No need for domain knowledge or explicit problem
representation: Just define the objective function and search space.
• Efficient in small search spaces: Can quickly find good solutions due
to the chance of randomly stumbling upon the optimum.
• Robust to local minima: Less prone to getting stuck in local optima
compared to deterministic methods.
Disadvantages of Random Search:
• Inefficient in large search spaces: Randomly checking points
becomes inefficient as the space grows, and finding the optimum
takes longer.
• No guarantee of finding the global optimum: May get stuck in
suboptimal regions and miss the best solution entirely.
• No information about solution quality: Provides no insight into how
close the found solution is to the actual optimum.
• Cannot adapt to the problem structure: Doesn't utilize any problem-
specific knowledge or guidance, potentially wasting resources.
• May require many iterations: Converging to acceptable solutions
might require a large number of random evaluations, increasing
computational cost.
To conclude:
Random search is a good choice for:
• Simple problems with small search spaces.
• Early exploration during optimization, to get a quick estimate
of the solution space.
• Problems where domain knowledge is scarce or difficult to
integrate into an algorithm.
Practicals
Q1. WAPP to find the solution of 8 puzzle using random search.

Q2. WAPP to find the minimum of quadratic equation 2x2−5x+3


in the range [-10,10] using random search.

Q3. WAPP for password cracking using random search,


incorporating character combinations

You might also like