AI Ch3.2
AI Ch3.2
Lecture Outline
Uninformed (Blind) search
Uninformed Search
• These strategies have no additional information about states beyond that provided in the
problem definition.
• All they can do is generate successors and distinguish a goal state from a non-goal state.
• All search strategies are distinguished by the order in which nodes are expanded.
• تتميز هذه االستراتيجيات بعدم وجود معلومات إضافية حول الحاالت بعد تلك المقدمة في تعريف
.المشكلة
.• كل ما يمكنها القيام به هو توليد الحاالت الفرعية وتمييز حالة الهدف عن حالة غير الهدف
.• تتميز جميع استراتيجيات البحث بالترتيب الذي يتم فيه توسيع العقد
Step cost = 1
• Breadth-first search
Bidirectional
Step cost = 1 Step cost =
• Depth-first search
Depth-limited
Iterative deepening
Step cost =
cost(action) >
• Uniform-Cost search
Page 1 of 14
By: Muhammad Mahmoud
Breadth first search
• idea: Expand shallowest unexpanded node
• Implementation: frontier is a FIFO queue, i.e. successors go in at the end of the queue.
• New nodes are inserted at the End of Frontier
• Frontier=(A)
• Explored=()
• Frontier=(B,C)
• Explored=(A) اتحذف
• Frontier=(C,D,E)
Explored=(A,B)
Page 2 of 14
By: Muhammad Mahmoud
Frontier=(D,E,F,G)
Explored=(A,B,C)
Page 3 of 14
By: Muhammad Mahmoud
Breadth-First Search Example Romania
completeness: does it always find a solution if one exists? :ُتقّيم االستراتيجيات على األبعاد التالية
هل تجد دائًما حًال إذا كان هناك حًال؟:االكتمال
time complexity: number of nodes generated
عدد العقد المولدة:تعقيد الوقت
space complexity: maximum number of nodes in memory الحد األقصى لعدد العقد في:تعقيد المساحة
optimality: does it always find a least-cost solution? الذاكرة
هل تجد دائًما حًال بأقل تكلفة؟:األمثلية
Time and space complexity are measured in terms of
b: maximum branching factor of the search tree يتم قياس تعقيد الوقت والمساحة بالنسبة ل
m: maximum depth of the state space (may be ∞) عمق الحل ذي التكلفة األقل:د
الحد األقصى لعمق المساحة الحالية (قد:م
∞ يكون
Page 5 of 14
By: Muhammad Mahmoud
Depth First Search
توسيع العقد غير الموسعة األعمق:• الفكرة
• Frontier=(A)
Explored=()
• Frontier=(B,C)
Explored=(A)
• Frontier=(D,E,C)
Explored=(A,B)
Page 6 of 14
By: Muhammad Mahmoud
• New nodes are inserted at the Front of FRONTIER.
• Frontier=(H,I,E,C)
Explored=(A,B,D)
• Frontier=(I,E,C)
Explored=(A,B,D,H)
• Frontier=(E,C)
Explored=(A,B,D,H,I)
Page 7 of 14
By: Muhammad Mahmoud
• New nodes are inserted at the Front of FRONTIER.
• Frontier=(J,K,C)
• Explored=(A,B,D,H,I,E)
• Frontier=(C)
• Explored=(A,B,D,H,I,E,J,K)
• Frontier=(F,G)
• Explored=(A,B,D,H,I,E,J,K,C)
Page 8 of 14
By: Muhammad Mahmoud
• New nodes are inserted at the Front of FRONTIER.
• Frontier=(L,M,G)
• Explored=(A,B,D,H,I,E,J,K,C,F)
• Fringe=(M,G)
• Explored=(A,B,D,H,I,E,J,K,C,F,L)
Page 9 of 14
By: Muhammad Mahmoud
Depth-Limited Strategy (DLS)
• Alleviate the problem of DFS in infinite state spaces by supplying it with a predetermined depth
limit l.
• Below this limit L, nodes are not expanded.
– Solution
– Failure (no solution)
– Cutoff (no solution within cutoff)
• DLS is incomplete when the shallowest goal is beyond the depth limit (l < d).
Page 10 of 14
By: Muhammad Mahmoud
iterative Deepening Search (IDS)
– Applies DLS repeatedly with increasing depth and terminates when a solution is found or no
solutions exists.
Page 11 of 14
By: Muhammad Mahmoud
Iterative deepening search with depth limit 0
Page 12 of 14
By: Muhammad Mahmoud
Iterative deepening search: Properties
First Search
Page 13 of 14
By: Muhammad Mahmoud
• الهدف هو إنشاء مسار حال .minimal cost
• مكافئ للبحث أوًال إذا كانت تكاليف الخطوات متساوية.
• يضمن العثور على الحل األول هو الحل األرخص.
Page 14 of 14
By: Muhammad Mahmoud