首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 62 毫秒
1.
林巧 《计算机时代》2002,(8):39-40,45
利用回溯法可求出一类问题的一组解或最优解,本文介绍了回溯的一般方法。 探讨了几个经典问题的回溯算法。  相似文献   

2.
解空间树分为子集树和排列树。进一步将子集树分为二叉树、多枝树。对回溯法在这两种解空间树中的应用给出了规律性的方法与步骤,从而使回溯法更加简单易用,并且从易到难给出了相应的实例,以及应用这些规律性方法得出的源代码。  相似文献   

3.
N皇后问题的回溯算法改进   总被引:2,自引:0,他引:2  
回溯算法是解决N皇后问题的经典算法。在分析N皇后问题的解结构的基础上,优化了利用回溯法求解N皇后问题的解空间树,并改进了互不攻击的条件,大大地减少了比较次数和求解的复杂度,通过理论分析和实验证明了改进算法的可行性。  相似文献   

4.
本文模拟人工智能的思路,用回溯法编程求解爱因斯坦谜题,使总排列数下降了7 个数量级,极大提高了解题 速度。程序编写了线索输入函数,把迷题线索存入向量中,可随意修改线索的内容、数量及顺序,进而对新的谜题进行重新求 解,而不用修改剪枝函数的代码,适用性好。  相似文献   

5.
正可以这样理解回溯法:将某一问题分成n个步骤,而每个步骤都有m个待定值,如果每个步骤都求得了满意的值,那么整个问题就得到了一个解。于是就可以从第一个步骤开始,从第一个值开始依次试探每个值,如果获取到一个符合条件的值,那么就进到下一个步骤,继续进行试探;如果某一步骤的m个值都试探到了,还是不能满足条件,那么就回退到  相似文献   

6.
哈密顿回路问题的DNA表面计算模型   总被引:1,自引:1,他引:0  
基于生化反应原理的DNA计算具有强大的并行运算能力,DNA计算机在求解NP问题上存在着硅计算机无法比拟的先天的优越性。论文采用荧光标记的策略,给出了一种新的哈密顿回路问题的DNA表面计算模型。该模型首先将问题解空间的DNA分子固定在固体载体上,然后通过进行相应的生化反应来求得哈密顿回路问题的所有解。在新模型中,解空间的生成过程与边的排列顺序无关。  相似文献   

7.
基于动态状态树的回溯算法   总被引:1,自引:0,他引:1  
介绍了背包问题及0-1背包问题,阐述了回溯算法(算法设计的基本方法之一)和状态空间的概念,提出一个基于动态状态空间树的回溯算法.以0-1背包问题为例,说明动态树方法对求解线性规划问题等是非常有用的,且该算法所用时间少于静态状态空间树方法,有助于扩大回溯算法的应用.  相似文献   

8.
八皇后问题是计算机科学中一个较经典的题目.本文提出用回溯法来解决八皇后问题,并给出了逻辑结构清晰、可读性强的递归算法,用C语言加以实现,得到了八皇后问题的12个真正不同的解.  相似文献   

9.
回溯法通过问题中的约束条件以试探-回溯-试探的筛选方式,将所有解的范围中不符合约束条件的解予以排除,从而达到快速求解的目的。本文以数独问题为模型,论述了回溯法在数独问题解法中的运行原理。  相似文献   

10.
使用Python开发语言,通过动态电路模型建模,采用递归回溯算法,编程解决了一道今年在网上比较火热的逻辑推理问题,并给出了最优的推理过程.这个建模和递归回溯方法,可以模拟人的逻辑推理过程,对解决同类的逻辑推理问题,有比较普遍的适用性.  相似文献   

11.
Solving the Hamiltonian path problem with a light-based computer   总被引:1,自引:1,他引:0  
In this paper we propose a special computational device which uses light rays for solving the Hamiltonian path problem on a directed graph. The device has a graph-like representation and the light is traversing it by following the routes given by the connections between nodes. In each node the rays are uniquely marked so that they can be easily identified. At the destination node we will search only for particular rays that have passed only once through each node. We show that the proposed device can solve small and medium instances of the problem in reasonable time.  相似文献   

12.
A Hamiltonian cycle is a spanning cycle in a graph, i.e., a cycle through every vertex, and a Hamiltonian path is a spanning path. In this paper we present two theorems stating sufficient conditions for a graph to possess Hamiltonian cycles and Hamiltonian paths. The significance of the theorems is discussed, and it is shown that the famous Ore's theorem directly follows from our result.  相似文献   

13.
Assume that P is any path in a bipartite graph G of length k with 2?k?h, G is said to be h-path bipancyclic if there exists a cycle C in G of every even length from 2k to |V(G)| such that P lies in C. In this paper, the following result is obtained: The n-dimensional hypercube Qn with n?3 is (2n−3)-path bipancyclic but is not (2n−2)-path bipancyclic, moreover, a path P of length k with 2?k?2n−3 lies in a cycle of length 2k−2 if and only if P contains two edges of the same dimension. In order to prove the above result we first show that any path of length at most 2n−1 is a subpath of a Hamiltonian path in Qn with n?2, moreover, the upper bound 2n−1 is sharp when n?4.  相似文献   

14.
Since finding whether a graph has a Hamiltonian path or Hamiltonian cycle are both NP-complete problems, researchers have been formulating sufficient conditions that ensure the path or cycle. Rahman and Kaykobad (2005) [2] presented a sufficient condition for determining the existence of Hamiltonian path. Three recent works-Lenin Mehedy, Md. Kamrul Hasan, Mohammad Kaykobad (2007) [3], Rao Li (2006) [4], Shengjia Li, Ruijuan Li, Jinfeng Feng (2007) [5]-further used the same or similar condition to ensure Hamiltonian cycle with some exceptions. The three works, along with their unique findings, have some common results. This paper unifies the results and brings them under Rahman and Kaykobad’s condition.  相似文献   

15.
Backjump-based backtracking for constraint satisfaction problems   总被引:1,自引:0,他引:1  
The performance of backtracking algorithms for solving finite-domain constraint satisfaction problems can be improved substantially by look-back and look-ahead methods. Look-back techniques extract information by analyzing failing search paths that are terminated by dead-ends. Look-ahead techniques use constraint propagation algorithms to avoid such dead-ends altogether. This paper describes a number of look-back variants including backjumping and constraint recording which recognize and avoid some unnecessary explorations of the search space. The last portion of the paper gives an overview of look-ahead methods such as forward checking and dynamic variable ordering, and discusses their combination with backjumping.  相似文献   

16.
哈密尔顿回路问题的DNA表面计算模型   总被引:1,自引:0,他引:1       下载免费PDF全文
首次提出用DNA表面计算模型来解决无向图哈密尔顿回路问题。该模型基于哈密尔顿回路问题的解空间,将问题解空间的DNA分子固定在固体载体上,对其进行荧光标记,然后通过相应的生化反应筛选出哈密尔顿回路问题的所有解。与已有的哈密尔顿路径问题的其它模型相比,新模型具有错误率低,编码简易,读取方便等更好的性能。  相似文献   

17.
A flip or edge-replacement is considered as a transformation by which one edge e of a geometric object is removed and an edge f (fe) is inserted such that the resulting object belongs to the same class as the original object. Here, we consider Hamiltonian planar paths as geometric objects. A technique is presented for transforming a given planar path into another one for a set S of n points in convex position in the plane. Under these conditions, we show that any planar path can be transformed into another planar path by at most 2n−5 flips. For the case when the points are in general position we provide experimental results regarding transformability of any planar path into another. We show that for n?8 points in general position any two paths can be transformed into each other. For n points in convex position we show that there are n2n−2 directed Hamiltonian planar paths. An algorithm is presented which uses flips of size 1 and flips of size 2 to generate all such paths with O(n) time between the generation of two successive paths.  相似文献   

18.
A software structure well-suited for the programming of interactive recognition and translation systems is described. This structure makes use of coroutines and backtracking in a highly coordinated and integrated fashion. A set of coroutine and backtracking primitives that supports this approach is defined. An example of the use of this approach is given.  相似文献   

19.
一个由接口路径求Hamilton回路的算法研究   总被引:2,自引:0,他引:2  
刘超  王文杰 《计算机科学》2010,37(9):252-256
为了求简单图中的所有Hamilton回路,首先,提出了一种对集合幂集进行编码的算法,引入了接口路径的概念,将Hamilton回路的运算转换为等级接口路径矩阵的运算;其次,结合肖尔茨猜想的证明,对算法复杂性的上限进行了估算;最后,以中国旅行商问题为例,给出了求解CTSP的精确算法.  相似文献   

20.
基于回溯法的全覆盖路径规划算法   总被引:1,自引:0,他引:1  
随着扫地机器人的快速发展,作为其核心技术的全覆盖路径规划技术也变得日益重要。目前已经提出的许多算法,如人工势场法、模板法、单元分解法等,都存在一些问题,如覆盖率低、重复率高、运行效率低等等。针对目前已有算法存在的问题,提出了一种基于回溯法的全覆盖路径规划算法。首先利用West-Move First算法实现局部区域覆盖,然后为了解决扫地机器人局部区域覆盖过程中存在遗漏区域未覆盖的问题,建立了完善的回溯机制,并采用改进的A~*算法规划出一条从死点到回溯点的光滑无障碍路径。通过与BA~*算法进行仿真对比分析,表明了该算法具有更高的运行效率和更低的重叠率。  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号