共查询到18条相似文献,搜索用时 625 毫秒
1.
曹健 《电脑编程技巧与维护》2014,(9)
正可以这样理解回溯法:将某一问题分成n个步骤,而每个步骤都有m个待定值,如果每个步骤都求得了满意的值,那么整个问题就得到了一个解。于是就可以从第一个步骤开始,从第一个值开始依次试探每个值,如果获取到一个符合条件的值,那么就进到下一个步骤,继续进行试探;如果某一步骤的m个值都试探到了,还是不能满足条件,那么就回退到 相似文献
2.
3.
4.
本文利用Viusal Basic的知识,对八皇后问题的算法进行分析,并在程序设计的过程中,通过对算法的改进,提高程序的运行效率。 相似文献
5.
6.
7.
8皇后问题是计算机算法设计领域里的经典问题。利用回溯算法和概率算法相结合的办法求解8皇后问题,通过实验分析第一次成功搜索到皇后位置的概率,以实验得出的数据为依据对现存的观点提出了质疑,并对实验数据进行了分析,肯定了本文数据的合理性。 相似文献
8.
王一盟 《电脑编程技巧与维护》2018,(7):52-56,76
使用Python开发语言,通过动态电路模型建模,采用递归回溯算法,编程解决了一道今年在网上比较火热的逻辑推理问题,并给出了最优的推理过程.这个建模和递归回溯方法,可以模拟人的逻辑推理过程,对解决同类的逻辑推理问题,有比较普遍的适用性. 相似文献
9.
回溯算法是基本的算法之一,其重要的思想是不断地用限界函数去测试正在构造的部分解向量,看是否导致合法解,回溯算法通常具有较高的时间复杂度,但对于至今除了穷尽搜索仍未找到其他的方法的问题,回溯算法是较为有效的方法.介绍了回溯算法,以及以经典的N皇后问题为例,讲解了用回溯算法求解问题,并分析了其空间复杂度,介绍了求解N皇后问题的改进回溯算法. 相似文献
10.
八皇后问题的非递归算法设计 总被引:1,自引:0,他引:1
采用回溯法来解决八皇后问题,用一种较好的数据类型来表示解空间,给出一种逻辑结构非常清晰的非递归算法,解决了递归算法中空间效率低的问题。 相似文献
11.
陈宇文 《电脑编程技巧与维护》2013,(14):14-17
解空间树分为子集树和排列树。进一步将子集树分为二叉树、多枝树。对回溯法在这两种解空间树中的应用给出了规律性的方法与步骤,从而使回溯法更加简单易用,并且从易到难给出了相应的实例,以及应用这些规律性方法得出的源代码。 相似文献
12.
Ateet Bhalla Inês Lynce José T. de Sousa João Marques-Silva 《Journal of Automated Reasoning》2005,35(1-3):3-24
In recent years backtrack search algorithms for propositional satisfiability (SAT) have been the subject of dramatic improvements.
These improvements allowed SAT solvers to successfully solve instances with thousands or tens of thousands of variables. However,
many new challenging problem instances are still too hard for current SAT solvers. As a result, further improvements to SAT
technology are expected to have key consequences in solving hard real-world instances. This paper introduces a new idea: choosing
the backtrack variable using a heuristic approach with the goal of diversifying the regions of the space that are explored
during the search. The proposed heuristics are inspired by the heuristics proposed in recent years for the decision branching
step of SAT solvers, namely, VSIDS and its improvements. Completeness conditions are established, which guarantee completeness
for the new algorithm, as well as for any other incomplete backtracking algorithm. Experimental results on hundreds of instances
derived from real-world problems show that the new technique is able to speed SAT solvers, while aborting fewer instances.
These results clearly motivate the integration of heuristic backtracking in SAT solvers. 相似文献
13.
Ordering heuristics are a powerful tool in CSP search algorithms. Among the most successful ordering heuristics are heuristics which enforce a fail first strategy by using the Min-domain property (Haralick and Elliott, Artif Intel 14:263–313, 1980; Bessiere and Regin, Mac and combined heuristics: two reasons to forsake FC (and CBJ?) on hard problems. In Proc. CP 96, pp. 61–75, Cambridge, MA, 1996; Smith and Grant, Trying harder to fail first. In European Conference on Artificial Intelligence, pp. 249–253, 1998; Dechter, Constraint Processing. Morgan Kaufman, 2003). Ordering heuristics have been introduced recently to asynchronous backtracking (ABT), for distributed constraints satisfaction (DisCSP) (Zivan and Meisels, Dynamic ordering for asynchronous backtracking on discsps. In CP-2005, pp. 32–46, Sigtes (Barcelona), Spain, 2005). However, the pioneering study of dynamically ordered ABT, ABT_DO, has shown that a straightforward implementation of the Min-domain heuristic does not produce the expected improvement over a static ordering. The present paper proposes an asynchronous dynamic ordering which does not follow the standard restrictions on the position of reordered agents in ABT_DO. Agents can be moved to a position that is higher than that of the target of the backtrack. Combining the Nogood-triggered heuristic and the Min-domain property in this new class of heuristics results in the best performing version of ABT_DO. The new version of retroactively ordered ABT is faster by a large factor than the best form of ABT. 相似文献
14.
An algorithm that performs asynchronous backtracking on distributed
, with dynamic ordering of agents is proposed,
. Agents propose reorderings of lower priority agents and send these proposals whenever they send assignment messages. Changes
of ordering triggers a different computation of
. The dynamic ordered asynchronous backtracking algorithm uses polynomial space, similarly to standard
. The
algorithm with three different ordering heuristics is compared to standard
on randomly generated
. A Nogood-triggered heuristic, inspired by dynamic backtracking, is found to outperform static order
by a large factor in run-time and improve the network load. 相似文献
15.
This article proposes a new mathematical definition of the execution of pure Prolog, in the form of axioms in a structural operational semantics. The main advantage of the model is its ease in representing backtracking, due to the functionality of the transition relation and its converse. Thus, forward and backward derivation steps are possible. A novel concept of stages is introduced, as a refinement of final states, which captures the evolution of a backtracking computation. An advantage over the traditional stack-of-stacks approaches is a modularity property. Finally, the model combines the intuition of the traditional ‘Byrd box’ metaphor with a compact representation of execution state, making it feasible to formulate and prove theorems about the model. In this paper we introduce the model and state some useful properties. 相似文献
16.
面向多模态函数优化的回溯克隆选择算法 总被引:1,自引:0,他引:1
针对多模态函数优化问题,提出了一种基于回溯机制的改进克隆选择算法--回溯克隆选择算法(BCSA),采用改进回溯机制和记忆库抗体抑制策略,保持了抗体的多样性,以增强算法的全局搜索能力;通过改进动态变异、选择与交叉操作提高算法收敛速度。典型的多模态函数测试结果表明:回溯克隆选择算法具有优良的全局搜索能力和搜索效率。 相似文献
17.
《Journal of Symbolic Computation》1994,18(1):1-40
A backtracking algorithm with element order selection is presented, and its efficiency discussed in relation both to standard examples and to examples concerning relation-preserving maps which the algorithm was derived to solve. 相似文献
18.
在当前几种常见的路由重建算法基础上,提出了一种基于k跳回溯机制的服务切换路由重建算法.根据移动终端的移动速度和网络的实际带宽情况动态选择位置更新信息的逆向回溯跳数k.本算法在位置更新信息的回溯过程中,寻找k跳范围内最优的路由重建公共点,使得呼叫节点经过该节点到达移动终端目标用户站的通信路由能够得到优化.同时,本算法要求接收到位置更新信息的中间节点以其到达目标用户站的最优通信路由转发接收到的数据包,降低服务切换过程中的数据包转发代价,使正在进行的网络服务能够在原用户站和目标用户站之间平滑地切换. 相似文献