Download presentation
Presentation is loading. Please wait.
2
راهبرد شاخه و حد (Branch and bound)
در رویکرد شاخهوحد نیز مانند رویکرد عقبگرد از ... درخت فضای حالت استفاده میکنیم. تفاوت این دو رویکرد در این است که: (1) در شاخهوحد محدود نیستیم تا برای پیمایش درخت فضای حالت فقظ از پیمایش ... Preorder استفاده کنیم. بلکه ... میتوانیم از هر نوع پیمایش سیستماتیک دیگر یا خلاقانه استفاده کنیم (2) روش شاخه و حد فقط برای مسائل بهینهسازی مناسب است.
3
راهبرد شاخه و حد در این رویکرد برای هر گره در درخت فضای حالت، حد (bound) ای محاسبه میشود تا مشخص شود که آن گره امیدبخش است یا خیر. bound هر گره بیانگر حدی از مقدارهای m(x,y) است که با گسترش آن گره به دست میآید. اگر bound از بهترین m(x,y) ای که تاکنون بدست آمدهاست بهتر نباشد در این صورت ... گره امیدبخش نیست ودرغیراینصورت امیدبخش است.
4
راهبرد شاخه و حد با این توضیحات الگوریتم عقبگرد ارائه شده برای مساله کولهپشتی صفرویک عملا الگوریتم ... شاخه و حد است چراکه ... در آن الگوریتم هم گره امیدبخش نبود چنانچه bound از maxprofitای که تا آن زمان بدست آمده بود بزرگتر نبود.
5
راهبرد شاخه و حد علاوه بر این رویکرد میتوانیم رویکرد سادهتر «جستجوی سطح اول با هرس کردن شاخه و حد» را داشته باشیم.
6
راهبرد شاخه و حد رویکرد جستجوی سطح اول با هرس کردن شاخه و حد شامل: 1- ابتدا مشاهده ریشه 2- سپس تمامی گرههای در سطح اول 3- سپس تمامی گرههای در سطح دوم و ...
7
راهبرد شاخه و حد مساله کولهپشتی زیر با n=4 و W=16 را درنظر بگیرید:
8
راهبرد شاخه و حد
9
«جستجوی اولین-بهترین با هرسکردن شاخه و حد»
راهبرد شاخه و حد «جستجوی اولین-بهترین با هرسکردن شاخه و حد» به صورت عمومی استراتژی جستجوی سطح اول مزیتی نسبت به رویکرد عقبگرد ندارد. چراکه ... در آنجا درخت به صورت عمقی پیمایش میشد و در اینجا به صوت سطحی جستجوی سطح اول میتواند با پیشنهاد زیر زودتر پاسخ بهینه را پیدا کند: بعد از آنکه تمامی فرزندان یک گره مشاهد شد ... به جای اینکه بیاییم و از اول صف گره بعدی را برداریم و فرزندان آن را مشاهده کنیم ... بیاییم گرهی را از صف برداریم که دارای bound بزرگتری از بقیه باشد و فرزندان آن را مشاهده کنیم. این رویکرد دارای سرعت همگرایی بیشتری نسبت به دو حالت قبل است.
10
void best_first_branch_and_bound(state_space_tree T,number& best){
priority_queue_of_node PQ; node u, v; initialize (PQ); // Initialize PQ to be empty. v = root of T; best = value(v); insert (PQ, v); while (! empty (PQ)) { remove (PQ, v); if (bound (v) is better than best) for (each child u of v) { // promising. if (value(u) is better than best) (best = value (u); if (bound (u) is better than best) insert (PQ, u); }
12
راهبرد شاخه و حد،مساله فروشنده دورهگرد
Traveling Salesperson Problem (TSP) Goal: find the shortest path in a … directed graph that … starts at a given vertex, visits each vertex in the graph exactly once, and ends up back at the starting vertex. Such a path is called an optimal tour. Because it does not matter where we start, the starting vertex can simply be the first vertex.
13
راهبرد شاخه و حد،مساله فروشنده دورهگرد
The adjacency matrix of a graph and An optimal tour for that graph.
14
راهبرد شاخه و حد،مساله فروشنده دورهگرد
An obvious state space tree: level1: each vertex other than the starting one level2: each vertex other than the starting one and the one chosen at level 1 next levels: and so on.
15
راهبرد شاخه و حد،مساله فروشنده دورهگرد
A portion of this state space tree, in which there are five vertices and in which there is an edge from every vertex to every other vertex
16
راهبرد شاخه و حد،مساله فروشنده دورهگرد
Each leaf represents a tour. We need to find a leaf that contains an optimal tour. We stop expanding the tree when there are four vertices in the path stored at a node because, at that time, the fifth one is uniquely determined. For example, the far-left leaf represents the tour [1, 2, 3, 4, 5, 1] because once we have specified the path [1, 2, 3, 4], the next vertex must be the fifth one.
17
راهبرد شاخه و حد،مساله فروشنده دورهگرد
To use best-first search, we need to be able to determine a bound for each node. In this problem, we need to determine a lower bound on … the length of any tour that can be obtained by expanding we call the node promising only if … its bound is less than the current minimum tour length.
18
راهبرد شاخه و حد،مساله فروشنده دورهگرد
bound as follows: In any tour, the length of the edge taken when leaving a vertex must be at least as great as the length of the shortest edge emanating from that vertex. Because a tour must leave every vertex exactly once, a lower bound on the length of a tour is the sum of these minimums. Therefore, a lower bound on the length of a tour is
19
راهبرد شاخه و حد،مساله فروشنده دورهگرد
Suppose we have visited the node containing [1, 2]. Any tour obtained by expanding beyond this node, therefore, has the following lower bounds on the costs of leaving the vertices: A lower bound beyond the node containing [1, 2]:
20
راهبرد شاخه و حد،مساله فروشنده دورهگرد
Suppose we have visited the node containing [1, 2, 3]: A lower bound beyond the node containing [1, 2, 3]:
21
راهبرد شاخه و حد،مساله فروشنده دورهگرد
22
راهبرد شاخه و حد،مساله فروشنده دورهگرد
When two or more bounding functions are available: However, our goal is not to visit as few nodes as possible, but rather to maximize the overall efficiency of the algorithm. The extra computations done when using more than one bounding function may better than savings realized by visiting fewer nodes.
23
Abductive Inference (Diagnosis) استنتاج فرضیهای (تشخیص)
An important problem in artificial intelligence and expert systems is determining the most probable explanation for some findings. For example: in medicine we want to determine the most probable set of diseases, given a set of symptoms. Process of determining the most probable explanation for a set of findings is called abductive inference.
24
Abductive Inference (Diagnosis)
Assume: There are n diseases, d1, d2,…, dn, each of which may be present in a patient. We know that the patient has a certain set of symptoms S. Our goal: Finding the set of diseases that are most probably present.
25
Abductive Inference (Diagnosis)
این مساله به صورت چهارتایی (I, f, m, g) بیان میشوند که .... I مجموعههای مختلف از احتمال بیماریهای d1, d2,…, dn برای مجموعهای علائم بیماری S است (مجموعهای از p(di |S) ). xای که عضوی از I است را درنظر بگیریم. مثلا ... مثلا میتوان }فشار خون بالا، تپش قلب، خوابآلودگی، افت قند خونS={ را درنظر گرفت و به ازای هر di عضو مجموعه بالا، p(di |S) مشخص شده باشد. f(x) مجموعه راه حلهای ممکن یعنی تمامی D⊂D که چنانچه y یکی از انها باشد، m(x,y)=p(y|S) g، تابع هدف است که در اینجا max میباشد.
26
Abductive Inference (Diagnosis)
Our goal: Finding the set of diseases that are most probably present.
27
Abductive Inference (Diagnosis)
State Space Tree: We go to the left of the root to include d1, and we go to the right to exclude it. Similarly, we go to the left of a node at level 1 to include d2, and we go to the right to exclude it, and so on. Each leaf in the state space tree represents a possible solution So, we compute the conditional probability of the set of diseases at each leaf, and determine which one has the largest conditional probability.
28
Abductive Inference (Diagnosis)
To prune using best-first search, we need to … find a bounding function. The following theorem accomplishes this for a large class of instances.
29
Abductive Inference (Diagnosis)
If D and D′ are two sets of diseases such that then Proof: According to Bayes’ theorem, The first inequality is by the assumption in this theorem, and the second follows from the fact that any probability is less than or equal to 1. This proves the theorem.
30
Abductive Inference (Diagnosis)
For a given node, let D be the set of diseases that have been included up to that node, and for some descendant of that node, let D‘ be the set of diseases that have been included up to that descendant. Then D ⊆ D′. Often it is reasonable to assume that So, Therefore, p(D) /p(S) is an upper bound on the conditional probability of the set of diseases in any descendant of the node.
31
Abductive Inference (Diagnosis)
Suppose: there are four possible diseases d1, d2, d3, and d4 and a set of symptoms S. The input to this example would also include a Bayesian network containing the probabilistic relationships among the diseases and the symptoms. These probabilities are not computed in this text. We assign arbitrary probabilities to illustrate the best-first search algorithm.
32
Abductive Inference (Diagnosis)
33
Abductive Inference (Diagnosis)
34
Abductive Inference (Diagnosis)
35
Abductive Inference (Diagnosis)
36
Abductive Inference (Diagnosis)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.