Session 3
Session 3
ARTIFICIAL
INTELLIGENT SYSTEMS
SESSION NO: 3.2
TOPIC: INTRODUCTION TO HEURISTICS
SESSION INTRODUCTION
2
SESSION INTRODUCTION…..
• Heuristic functions are the most common form in which additional knowledge of the
problem is imparted to the search algorithm.
• Heuristics is a method of problem-solving where the goal is to come up with a workable
solution in a feasible amount of time.
• Heuristic techniques strive for a rapid solution that stays within an appropriate accuracy
range rather than a perfect solution.
• When it seems impossible to tackle a specific problem with a step-by-step approach,
heuristics are utilized in AI (artificial intelligence) and ML (machine learning).
3
SESSION INTRODUCTION…..
• Heuristic functions in AI prioritize speed above accuracy; hence they are frequently
paired with optimization techniques to provide better outcomes.
• What is the Heuristic Function?
• If there are no specific answers to a problem or the time required to find one is too great,
a heuristic function is used to solve the problem.
• The aim is to find a quicker or more approximate answer, even if it is not ideal.
• Put another way, utilizing a heuristic means trading accuracy for speed.
• A heuristic is a function that determines how near a state is to the desired state.
• Heuristics functions vary depending on the problem and must be tailored to match that
particular challenge.
4
SESSION INTRODUCTION…..
• The majority of AI problems revolve around a large amount of information, data, and
constraints, and the task is to find a way to reach the goal state.
• The heuristics function in this situation informs us of the proximity to the desired
condition.
• With a good heuristic function, however, the complexity can be reduced substantially.
• The amount of the reduction depends on the particular problem and on the quality of the
heuristic.
5
PROPERTIES OF A HEURISTIC SEARCH
ALGORITHM
• Heuristic search algorithms have the following properties:
• Admissible Condition: If an algorithm produces an optimal result, it is considered
admissible.
• Completeness: If an algorithm ends with a solution, it is considered complete.
• Dominance Property: If A1 and A2 are two heuristic algorithms and have h1 and h2
heuristic functions, respectively, then A1 Will dominate A2 if h1 is superior to h2 for all
possible values of node n.
• Optimality Property: If an algorithm is thorough, allowable, and dominates the
other algorithms, that'll be the optimal one and will unquestionably produce an optimal result.
6
CATEGORIES OF HEURISTIC SEARCH TECHNIQUES IN AI
7
Categories of Heuristic Search Techniques in AI
• Weak Heuristic Techniques:
• Weak heuristic techniques are known as a Heuristic control strategy, informed
search, and Heuristic search. These are successful when used effectively on the
appropriate tasks and typically require domain-specific knowledge.
• To explore and expand, users require additional information to compute preferences
across child nodes. A heuristic function is connected to each node.
8
STRATEGIES WHERE USE HEURISTIC FUNCTIONS
• Let's first look at some of the strategies we frequently see before detailing specific ones.
Here are a few examples.
• A* Search
• Best-first search
• Tabu search
• Bidirectional search
• Constant satisfaction problems
• Hill climbing
9
EXAMPLES OF HEURISTIC FUNCTIONS IN AI
• Search Engine:
• People have been interested in SEO as long as there have been searching engines.
• Users want to quickly discover the information they need when utilizing a search engine.
• Search engines use heuristics to speed up the search process because such a staggering
amount of data is available.
• A heuristic could initially attempt each alternative at each stage. Still, as the search
progresses, it can quit at any point if the present possibility is inferior to the best solution
already found.
• The search engine's accuracy and speed can be improved in this way.
11
EXAMPLES OF HEURISTIC FUNCTIONS IN AI
• Best-first algorithms include as a component of f, a heuristic function, denoted with h(n) where:
H(n) = estimated cost of the cheapest path from the state at node n to a goal state.
• Greedy best-first search tries to expand the node that is closest to the goal, on the grounds that this
is likely to lead to a solution quickly. Thus, it evaluates nodes by using just the heuristic function;
that is,
f (n) = h(n).
• A* Search: The most widely known form of best-first search is called A* search evaluates nodes by
combining g(n), the cost to reach the node, and h(n), the cost to get from the node to the goal:
f(n) = g(n) + h(n)
g(n) gives the path cost from the start node to node n, and h(n) is the estimated cost of the cheapest
path from r. to the goal, we have
f (n) = estimated cost of the cheapest solution through n.
12
SUMMARY
• One benefit of using heuristic algorithms is the ability to generate a workable solution to
the situation at hand quickly.
• Since the solution is quick enough, it can be imperfect; a close fit will do.
13
SELF ASSESSMENT QUESTIONS
1.Which of the following heuristic function used in Greedy Best first search?
(b) f(n)=g(n)
(c) f(n)=g(n)+h(n)
(d) f(n)=h(n)
14
SELF ASSESSMENT QUESTIONS
(a) A*
(b) TSP
(c) GBFS
(d) DFS
15
TERMINAL QUESTIONS
1. Discuss how heuristic functions will be useful in achieving rapid solution in search
problems.
2. List out the types of heuristics.
3. List out some examples of direct and indirect heuristic techniques.
16
REFERENCE BOOKS AND WEB LINKS
• Reference Books:
• 1. Patrick Henry Winston, ‘Artificial Intelligence’, Pearson Education (2003)
• 2. G. Luger, W. A. Stubblefield, "Artificial Intelligence", Third Edition, Addison-Wesley,
(2007)
• 3. William F. Clocksin, Christopher S. Mellish-Programming in Prolog-Springer (2003)
• 4. Introducing Data science by Davy cielen, Arno D.B.Meysmen, Mohamed Ali
• Sites and Web links:
• 1. https://www.youtube.com/watch?v=K9gH7hBAdpo (by IIT Delhi)
• 2. https://www.youtube.com/watch?
v=GHpchgLoDvI&list=PLp6ek2hDcoNB_YJCruBFjhF79f5ZHyBuz
• 3. https://www.ics.uci.edu/~dechter/courses/ics-271/fall-12/
17