猕猴桃不能和什么一起吃| 小肚子左边疼是什么原因| 词牌名是什么意思| 百花齐放是什么生肖| 怀孕做nt检查什么| 门前的小树已成年是什么歌| 糟卤可以做什么菜| 猫什么时候打疫苗| 血糖高会出现什么症状| 信徒什么意思| 一头雾水什么意思| 老被蚊子咬是什么原因| 为什么大医院不用宫腔镜人流| 晚上睡觉口干舌燥是什么原因| 最近有什么新闻| 梦见老宅是什么意思| 22是什么生肖| 11月9号是什么日子| 中央委员什么级别| 去疤痕挂什么科| 命里缺什么怎么看| 什么是生粉| 123是什么意思| 报考军校需要什么条件| 长残了是什么意思| 蛊惑是什么意思| 黄皮什么时候成熟| 乙肝两对半和乙肝五项有什么区别| 头是什么意思| 草字头加叔念什么| 臣字五行属什么| 腹股沟淋巴结肿大挂什么科| 乌鸡炖什么好吃| 广州有什么小吃特产| 手掌心出汗是什么原因| 脑供血不足检查什么项目| 谷氨酰基转移酶高是什么原因| 白细胞高吃什么药| cst是什么意思| 肛门是什么| 戴帽子是什么意思| 银针白毫是什么茶| 额头容易出汗是什么原因| 女性多吃什么滋补卵巢| 胯疼是什么原因| 甲状腺球蛋白低说明什么| 健身后应该吃什么| 胸内科主要看什么病| bnp是什么| 香榧是什么东西| 80年出生属什么生肖| 上海玉佛寺求什么最灵验| 关节响是什么原因| 精液偏黄是什么原因| 舌头开裂吃什么药| 舌苔厚白中间有裂纹吃什么药| 粘液丝是什么| 空调干燥是什么意思| 什么是爱呢| 甲状腺功能挂什么科| 什么虫咬了起水泡| 三阳开泰是什么生肖| 孟母三迁的故事告诉我们什么道理| 劳烦是什么意思| 为什么不建议儿童做胃镜| 上午十点是什么时辰| 蛇跟什么生肖相冲| 牛骨煲什么汤对儿童好| 前轮轴承坏了会有什么症状| 关节咔咔响是什么原因| 建兰什么时候开花| 桃子不能和什么水果一起吃| 李商隐是什么朝代的| 贱是什么意思| 混剪是什么意思| 荨麻疹什么样| 什么人不适合艾灸| 龙虾吃什么食物| 木代表什么生肖| 晚上咳嗽是什么原因| 淋巴净排是什么服务| 盆腔炎是什么原因造成的| 愚不可及是什么意思| 飞蓬草有什么功效| showroom是什么意思| 秋葵有什么营养价值| 梦见自己离婚是什么预兆| 上焦火吃什么药最有效| 小猫吃什么东西| 肚脐眼周围痛挂什么科| 女人右眼皮跳是什么预兆| 儿童掉头发什么原因| 阴血是什么| 什么是备皮| act是什么意思| 腿肿脚肿是什么原因引起的| 火象是什么意思| 淋球菌培养是检查什么| 折耳猫是什么| 腿纹不对称有什么影响| 临盆是什么意思| 束脚裤配什么鞋子| 子宫前位和子宫后位有什么区别| 物料是什么意思| 子宫穿孔有什么症状| 胰腺炎吃什么水果| 反胃吃什么可以缓解| 肝火旺吃什么药| 肝囊肿吃什么药能消除| 肛瘘是什么原因造成的| 每次睡觉都做梦为什么| 什么是妊娠| 乐五行属什么| 火召是什么字| 泥鳅能钓什么鱼| 男孩子断掌有什么说法| 可卡因是什么| 喉咙不舒服是什么原因| 睡着后抽搐抖动是什么| tdp是什么| sop是什么意思| 西安有什么好吃的特产| 百香果是什么季节的水果| 714什么星座| 叶公好龙的好是什么意思| 鹿晗什么星座| 吃什么能化解肾结石| 男生圆脸适合什么发型| hcg偏高是什么原因| 梵蒂冈为什么没人敢打| 景象什么意思| 皮肤炎症用什么药| 榴莲什么时候最便宜| opo是奶粉里的什么成分| xxoo是什么| 乌龟浮水是什么原因| 新生儿湿疹抹什么药膏| 塑料属于什么垃圾| 处女座什么性格| 灰指甲看什么科| 拍大腿内侧有什么好处| 噤若寒蝉是什么生肖| 彩超无回声是什么意思| 卒中什么意思| 吃相难看是什么意思| 三合局是什么意思| 女人耳垂大厚代表什么| 腰疼什么原因| 珠光宝气是什么生肖| 下焦不通吃什么中成药| 眼前有亮光闪是什么问题| 李果是什么水果| 怀孕一周有什么症状| 在什么之前的英文| 蜈蚣长什么样| 1.25什么星座| 芒果是什么意思| 手心脱皮是什么原因| 幽闭恐惧症是什么症状| 异常灌注是什么意思| 剃光头有什么好处| 葡萄糖属于什么糖| 阑尾炎在什么位置疼| 脸上起疙瘩是什么原因| 相亲第一次见面送什么礼物好| 黄瓜与什么食物相克| 自缢是什么意思| 乙肝两对半245阳性是什么意思| 视频脑电图能检查出什么| 白巧克力是什么做的| 梦到丢了一只鞋是什么意思| 非典是什么| 猪肝能钓什么鱼| 窥视是什么意思| 吃什么食物能升白细胞| 什么是早谢泄图片| 白事随礼钱有什么讲究| 月经提前了10天是什么原因| 小狗需要打什么疫苗| 实时播报什么意思| 发烧时不宜喝什么饮料| 行李箱什么材质的好| 新陈代谢慢是什么原因| 代价什么意思| 意念灰是什么意思| 2010是什么年| 腋下出汗是什么原因| 互为表里是什么意思| 寅虎是什么意思| 什么叫hp感染| 临兵斗者皆阵列在前什么意思| 对数是什么意思| 嗜是什么意思| 冬至为什么吃水饺| 一般什么人会有美人尖| 什么是假声| 站久了腰疼是什么原因| 农历8月13日是什么星座| 木是什么意思| 释怀和释然有什么区别| 意气用事是什么意思| 乙肝表面抗体阴性什么意思| 5月10号是什么星座| 什么叫红肉| 狗是什么属性| 角瓜念什么| 什么是甲沟炎| 为什么很多人不去庐山| 孝是什么| 男士私处瘙痒用什么药| bpd是胎儿的什么意思| 黄飞鸿是什么生肖| 黑色碳素笔是什么| 6月19日是什么节日| 骨碎补有什么功效| 梦见孕妇大肚子是什么意思| 1比1是什么意思| 被蛇咬了挂什么科| 看十全十美是什么生肖| 日本人为什么喜欢喝冰水| 永垂不朽是什么意思| 英国全称是什么| 兔子可以吃什么蔬菜| 感觉牙齿松动是什么原因| 新生儿黄疸高是什么原因| 黄疸是什么原因引起的| 保家仙是什么意思| 1026什么星座| 什么工作赚钱最快| 会考没过有什么影响| 入木三分是什么意思| 大姨妈量少是什么原因| 加码是什么意思| 大学生当兵有什么好处| 美人尖是什么意思| hpv阳性是什么意思| 男人前列腺炎有什么症状表现| 莲花代表什么生肖| 遥不可及什么意思| 肛门看什么科| 游走性疼痛挂什么科| 什么是表达方式| 钟馗是什么人物| 喜欢吃肉的动物是什么生肖| 什么叫甲沟炎| 咳嗽咳到吐是什么原因| 双规什么意思| 孵化器公司是干什么的| 耳塞戴久了有什么危害| 巴宝莉属于什么档次| 什么是植物人| 为什么血压高| 弱肉强食什么意思| 高抬贵手是什么意思| 女人大腿内侧黑是什么原因引起的| 绿色心情是什么意思| 淮山跟山药有什么区别| 深沉是什么意思| 暨怎么读什么意思| 孕妇吸二手烟对胎儿有什么影响| 全身出虚汗多是什么原因造成的| 知了的学名叫什么| 守株待兔是什么生肖| 神经衰弱吃什么药效果最好| 百度Jump to content

德国青少年沉迷社交网络引忧虑

From Wikipedia, the free encyclopedia
Iterative deepening depth-first search
ClassSearch algorithm
Data structureTree, Graph
Worst-case performance, where is the branching factor and is the depth of the shallowest solution
Worst-case space complexity[1]
Optimalyes (for unweighted graphs)
百度 值得一提的是,荣华实业的主要业务就是浙商矿业的黄金开采、选冶、加工与销售。

In computer science, iterative deepening search or more specifically iterative deepening depth-first search[1] (IDS or IDDFS) is a state space/graph search strategy in which a depth-limited version of depth-first search is run repeatedly with increasing depth limits until the goal is found. IDDFS is optimal, meaning that it finds the shallowest goal.[2] Since it visits all the nodes in the search tree down to depth before visiting any nodes at depth , the cumulative order in which nodes are first visited is effectively the same as in breadth-first search. However, IDDFS uses much less memory.[1]

Algorithm for directed graphs

[edit]

The following pseudocode shows IDDFS implemented in terms of a recursive depth-limited DFS (called DLS) for directed graphs. This implementation of IDDFS does not account for already-visited nodes.

function IDDFS(root) is
    for depth from 0 todo
        found, remaining ← DLS(root, depth)
        if found ≠ null then
            return found
        else if not remaining then
            return null

function DLS(node, depth) is
    if depth = 0 then
        if node is a goal then
            return (node, true)
        else
            return (null, true)    (Not found, but may have children)

    else if depth > 0 then
        any_remaining ← false
        foreach child of node do
            found, remaining ← DLS(child, depth?1)
            if found ≠ null then
                return (found, true)   
            if remaining then
                any_remaining ← true    (At least one node found at depth, let IDDFS deepen)
        return (null, any_remaining)

If the goal node is found by DLS, IDDFS will return it without looking deeper. Otherwise, if at least one node exists at that level of depth, the remaining flag will let IDDFS continue.

2-tuples are useful as return value to signal IDDFS to continue deepening or stop, in case tree depth and goal membership are unknown a priori. Another solution could use sentinel values instead to represent not found or remaining level results.

Properties

[edit]

IDDFS achieves breadth-first search's completeness (when the branching factor is finite) using depth-first search's space-efficiency. If a solution exists, it will find a solution path with the fewest arcs.[2]

Iterative deepening visits states multiple times, and it may seem wasteful. However, if IDDFS explores a search tree to depth , most of the total effort is in exploring the states at depth . Relative to the number of states at depth , the cost of repeatedly visiting the states above this depth is always small.[3]

The main advantage of IDDFS in game tree searching is that the earlier searches tend to improve the commonly used heuristics, such as the killer heuristic and alpha–beta pruning, so that a more accurate estimate of the score of various nodes at the final depth search can occur, and the search completes more quickly since it is done in a better order. For example, alpha–beta pruning is most efficient if it searches the best moves first.[3]

A second advantage is the responsiveness of the algorithm. Because early iterations use small values for , they execute extremely quickly. This allows the algorithm to supply early indications of the result almost immediately, followed by refinements as increases. When used in an interactive setting, such as in a chess-playing program, this facility allows the program to play at any time with the current best move found in the search it has completed so far. This can be phrased as each depth of the search corecursively producing a better approximation of the solution, though the work done at each step is recursive. This is not possible with a traditional depth-first search, which does not produce intermediate results.

Asymptotic analysis

[edit]

Time complexity

[edit]

The time complexity of IDDFS in a (well-balanced) tree works out to be the same as breadth-first search, i.e. ,[1]:?5? where is the branching factor and is the depth of the goal.

Proof

[edit]

In an iterative deepening search, the nodes at depth are expanded once, those at depth are expanded twice, and so on up to the root of the search tree, which is expanded times.[1]:?5? So the total number of expansions in an iterative deepening search is

where is the number of expansions at depth , is the number of expansions at depth , and so on. Factoring out gives

Now let . Then we have

This is less than the infinite series

which converges to

, for

That is, we have

, for

Since or is a constant independent of (the depth), if (i.e., if the branching factor is greater than 1), the running time of the depth-first iterative deepening search is .

Example

[edit]

For and the number is

All together, an iterative deepening search from depth all the way down to depth expands only about more nodes than a single breadth-first or depth-limited search to depth , when .[4]

The higher the branching factor, the lower the overhead of repeatedly expanded states,[1]:?6? but even when the branching factor is 2, iterative deepening search only takes about twice as long as a complete breadth-first search. This means that the time complexity of iterative deepening is still .

Space complexity

[edit]

The space complexity of IDDFS is ,[1]:?5? where is the depth of the goal.

Proof

[edit]

Since IDDFS, at any point, is engaged in a depth-first search, it need only store a stack of nodes which represents the branch of the tree it is expanding. Since it finds a solution of optimal length, the maximum depth of this stack is , and hence the maximum amount of space is .

In general, iterative deepening is the preferred search method when there is a large search space and the depth of the solution is not known.[3]

Example

[edit]

For the following graph:

a depth-first search starting at A, assuming that the left edges in the shown graph are chosen before right edges, and assuming the search remembers previously-visited nodes and will not repeat them (since this is a small graph), will visit the nodes in the following order: A, B, D, F, E, C, G. The edges traversed in this search form a Trémaux tree, a structure with important applications in graph theory.

Performing the same search without remembering previously visited nodes results in visiting nodes in the order A, B, D, F, E, A, B, D, F, E, etc. forever, caught in the A, B, D, F, E cycle and never reaching C or G.

Iterative deepening prevents this loop and will reach the following nodes on the following depths, assuming it proceeds left-to-right as above:

  • Depth 0: A
  • Depth 1: A, B, C, E

(Iterative deepening has now seen C, when a conventional depth-first search did not.)

  • Depth 2: A, B, D, F, C, G, E, F

(It still sees C, but that it came later. Also it sees E via a different path, and loops back to F twice.)

  • Depth 3: A, B, D, F, E, C, G, E, F, B

For this graph, as more depth is added, the two cycles "ABFE" and "AEFB" will simply get longer before the algorithm gives up and tries another branch.

[edit]

Similar to iterative deepening is a search strategy called iterative lengthening search that works with increasing path-cost limits instead of depth-limits. It expands nodes in the order of increasing path cost; therefore the first goal it encounters is the one with the cheapest path cost. But iterative lengthening incurs substantial overhead that makes it less useful than iterative deepening.[3]

Iterative deepening A* is a best-first search that performs iterative deepening based on "f"-values similar to the ones computed in the A* algorithm.

Bidirectional IDDFS

[edit]

IDDFS has a bidirectional counterpart,[1]:?6? which alternates two searches: one starting from the source node and moving along the directed arcs, and another one starting from the target node and proceeding along the directed arcs in opposite direction (from the arc's head node to the arc's tail node). The search process first checks that the source node and the target node are same, and if so, returns the trivial path consisting of a single source/target node. Otherwise, the forward search process expands the child nodes of the source node (set ), the backward search process expands the parent nodes of the target node (set ), and it is checked whether and intersect. If so, a shortest path is found. Otherwise, the search depth is incremented and the same computation takes place.

One limitation of the algorithm is that the shortest path consisting of an odd number of arcs will not be detected. Suppose we have a shortest path When the depth will reach two hops along the arcs, the forward search will proceed from to , and the backward search will proceed from to . Pictorially, the search frontiers will go through each other, and instead a suboptimal path consisting of an even number of arcs will be returned. This is illustrated in the below diagrams:

Bidirectional IDDFS

What comes to space complexity, the algorithm colors the deepest nodes in the forward search process in order to detect existence of the middle node where the two search processes meet.

Additional difficulty of applying bidirectional IDDFS is that if the source and the target nodes are in different strongly connected components, say, , if there is no arc leaving and entering , the search will never terminate.

Time and space complexities

[edit]

The running time of bidirectional IDDFS is given by

and the space complexity is given by

where is the number of nodes in the shortest -path. Since the running time complexity of iterative deepening depth-first search is , the speedup is roughly

Pseudocode

[edit]
function Find-Shortest-Path(s, t) is
   if s = t then
       return <s>
   (B, F, Vf, Vb) := (empty stack, ?, ?, ?)
   (Δ, lf, lb) := (0, 0, 0)
   forever do
       (F, Vf) := (?, ?)
       Depth-Limited-Search-Forward(s, Δ, F, Vf)
       if |Vf| = lf then
           return nil
       (lf, Vb) := (|Vf|, ?)
       μ := Depth-Limited-Search-Backward(t, Δ, B, F, Vb)
       if μ  nil then
           return Build-Path(s, μ, B, G)
       Vb := ?
       μ := Depth-Limited-Search-Backward(t, Δ + 1, B, F, Vb)
       if μ  nil then
           return Build-Path(s, μ, B, G)
       if |Bb| = lb  then
           return nil
       (lb, Δ) := (|Vb|, Δ + 1)
function Build-Path(s, μ, B) is
    π := Find-Shortest-Path(s, μ) (Recursively compute the path to the relay node)
    Pop(B)
    return π  B (Append the stack starting from its top.)
function Depth-Limited-Search-Forward(u, Δ, F, V) is
    if u ∈ V then
        return
    V := V ∪ {u}
    if Δ = 0 then
        F := F ∪ {u} (Mark u as a frontier node.)
        return
    foreach child of u do
        Depth-Limited-Search-Forward(child, Δ ? 1, F, V)
function Depth-Limited-Search-Backward(u, Δ, B, F, V) is
    if u ∈ V then
        return nil
    Push(B, u)
    if Δ = 0 then
        if u ∈ F  then
            return u (Reached the marked node, use it as a relay node)
        Pop(B)
        return nil
    V := V ∪ {u}
    foreach parent of u do
        μ := Depth-Limited-Search-Backward(parent, Δ ? 1, B, F, V)
        if μ  nil then
            return μ
    Pop(B)
    return nil

References

[edit]
  1. ^ a b c d e f g h Korf, Richard (1985). "Depth-first Iterative-Deepening: An Optimal Admissible Tree Search". Artificial Intelligence. 27: 97–109. doi:10.1016/0004-3702(85)90084-0. S2CID 10956233.
  2. ^ a b David Poole; Alan Mackworth. "3.5.3 Iterative Deepening? Chapter 3 Searching for Solutions ? Artificial Intelligence: Foundations of Computational Agents, 2nd Edition". artint.info. Retrieved 29 November 2018.
  3. ^ a b c d Russell, Stuart J.; Norvig, Peter (2003), Artificial Intelligence: A Modern Approach (2nd ed.), Upper Saddle River, New Jersey: Prentice Hall, ISBN 0-13-790395-2
  4. ^ Russell; Norvig (1994). Artificial Intelligence: A Modern Approach.
口腔炎吃什么药 六月初二是什么星座 不将就什么意思 酸奶能做什么美食 砂仁为什么要后下
脸上为什么会长痣 老鼠跟什么属相最配 胯骨疼挂什么科 臭屁什么意思 伤食是什么意思
甲鱼和什么食物相克 女人长期喝西洋参有什么好处 变态反应科是看什么病的 什么是机制 一什么珍珠
塔罗牌愚者是什么意思 什么是四环素牙 什么的夏夜 mrmrs是什么牌子 浪凡算是什么档次的
什么矿泉水最好hcv9jop0ns1r.cn 死心是什么意思hcv9jop0ns6r.cn 教师节送什么礼物呢imcecn.com 鹊桥是什么意思hcv7jop4ns8r.cn 白细胞偏低是什么原因liaochangning.com
秋天有什么植物cl108k.com 九月十九是什么星座hcv8jop0ns8r.cn 什么是静脉曲张hcv9jop6ns8r.cn 去医院看脚挂什么科hcv9jop6ns3r.cn 淡盐水是什么hcv9jop0ns3r.cn
候车是什么意思shenchushe.com 13数字代表什么意思hcv8jop5ns0r.cn 彩虹为什么有七种颜色hcv9jop8ns1r.cn 一日清闲一日仙是什么生肖hcv7jop6ns7r.cn 做肌电图挂什么科xinjiangjialails.com
骨折后吃什么食物促进骨头愈合shenchushe.com 手脚麻木吃什么药hcv9jop5ns2r.cn 炖鸡放什么调料好吃hcv9jop2ns5r.cn 胆结石有什么症状hcv9jop3ns5r.cn 鱿鱼炒什么好吃zsyouku.com
百度