共查询到20条相似文献,搜索用时 373 毫秒
1.
针对串行算法模型下基于顶点遍历图的情况,提出了一种在CREWPRAM并行模型下遍历无向图的算法。该算法是找出无向图的一棵最短路径生成树,由向上和向下两条有向边替换最短路径生成树的每条边形成欧拉回路,运用欧拉回路技术计算前缀和,前缀和所对应的顶点即为遍历无向图的顺序。得出了该算法时间复杂度为O(n+logn)的结论。 相似文献
2.
3.
图的着色问题是一个NP难问题,本文着重探讨无向图的顶点的三色问题,提出了用构造三角环的极大独立集方法判断并尝试给出顶点三色问题的可行解,解决了顶点三色的可满足性问题,克服了以前图遍历过程中的回溯问题,以及由此推论顶点四色和五色问题的极大独立集。 相似文献
4.
从中序遍历及后序遍历构造二叉树 总被引:1,自引:0,他引:1
本文给出了一个算法,该算法输入一棵二叉树的中序遍历和后序遍历的结点序列,构造出该二叉树。该算法具有O(n)时间复杂度,是解决该问题的最优算法,其中n为二叉树的结点数。 相似文献
5.
基于改进遍历矩阵和像素值扩散的通用图像加密算法 总被引:1,自引:0,他引:1
为了提高遍历矩阵的随机性和安全性,实现对图像信息的有效保护,提出了遍历矩阵构造的新方法,并结合像素值扩散设计了一种有效的图像加密算法。首先,利用混沌序列构造出完全不依赖载体图像灰度值的整数遍历矩阵,并利用此矩阵在图像空域进行迭代置乱,改进了传统遍历仅按特定路线扫描的局限性,以及对遍历周期和次数的过分依赖性;接着采用一个均匀分布的新混沌数列实现像素值扩散,改变了图像的统计特性,并使混沌映射不可逆;最后,构造出符合密码使用习惯的密钥生成系统,形成相对完整的加密体系,实现了图像加密。从统计特性、密钥空间、像素相关性、密钥敏感性、差分分析等多方面对算法的安全性进行了分析,结果表明,算法密钥空间大,抗攻击能力强,安全性高,实用性强。 相似文献
6.
SHENG Kui 《数字社区&智能家居》2008,(23)
通过对同一棵二叉树的前序遍历、中序遍历、后序遍历及层次遍历得到四个不同序列的分析,概括出二叉树的前序遍历、中序遍历、后序遍历及层次遍历序列间的关系,确定对应的二叉树。 相似文献
7.
8.
单慧如 《计算机光盘软件与应用》2011,(13)
本文介绍了由一棵二叉树的某两种遍历序列或某种遍历序列和结点的某种信息可以唯一确定该二叉树的各种可能方法。同时本文将给出基于先序序列和结点右孩子情况的构造二叉树的非递归的新算法。 相似文献
9.
10.
针对深度优先遍历图的非递归算法与递归算法得到的顶点访问序列不一致的问题,提出改进算法。实验结果表明,改进算法在算法时间和空间性能保持不变的情况下克服了原算法的不足。 相似文献
11.
Depth-first search is inherently sequential 总被引:3,自引:0,他引:3
John H. Reif 《Information Processing Letters》1985,20(5):229-234
This paper concerns the computational complexity of depth-first search. Suppose we are given a rooted graph G with fixed adjacency lists and vertices u, v. We wish to test if u is first visited before v in depth-first search order of G. We show that this problem, for undirected and directed graphs, is complete in deterministic polynomial time with respect to deterministic log-space reductions. This gives strong evidence that depth-first search ordering can be done neither in deterministic space (log n)c nor in parallel time (log n)c, for any constant c > 0. 相似文献
12.
We show how the fact that there is a first-order projection from the problem transitive closure (TC) to some other problem Ω enables us to automatically deduce that a natural game problem,
, whose instances are labelled instances of Ω, is complete for PSPACE (via log-space reductions). Our analysis is strongly dependent upon the reduction from TC to Ω being a logical projection in that it fails should the reduction be, for example, a log-space reduction or a quantifier-free first-order translation. 相似文献
13.
Journal of Computer and Systems Sciences International - The problem of constructing all simple paths in an undirected graph that pairwise connect vertices from the given set is interpreted as... 相似文献
14.
15.
《Theoretical computer science》2003,296(1):117-144
The paper presents a simple construction of polynomial length universal traversal sequences for cycles. These universal traversal sequences are log-space (even NC1) constructible and are of length O(n4.03). Our result improves the previously known upper-bound O(n4.76) for log-space constructible universal traversal sequences for cycles. 相似文献
16.
This paper investigates the leader-following consensus problem of multi-agent systems where the leader is static and the controlling effect of each follower depends on its own state. The control protocols are proposed for two cases: i) for network with switching topologies and undirected information flow; ii) for network with directed information flow and communication time-delays. With the aid of several tools from algebraic graph, matrix theory and stability theory, the sufficient conditions guaranteeing leader-following consensus are obtained by constructing appropriate Lyapunov functions. Simulations are presented to demonstrate the effectiveness of our theoretical results. 相似文献
17.
We prove that several problems concerning congruences on algebras are complete for nondeterministic log-space. These problems are: determining the congruence on a given algebra generated by a set of pairs, and determining whether a given algebra is simple or subdirectly irreducible. We also consider the problem of determining the smallest fully invariant congruence on a given algebra containing a given set of pairs. We prove that this problem is complete for nondeterministic polynomial time. 相似文献
18.
19.
20.
Clemens Lautemann 《Acta Informatica》1990,27(5):399-421
Summary Although in many ways, hyperedge replacement graph grammars (HRGs) are, among all graph generating mechanisms, what context-free Chomsky grammars are in the realm of string rewriting, their parsing problem is known to be, in general, NP-complete. In this paper, the main difficulty in HRG parsing is analysed and some conditions on either grammar or input graphs are developed under which parsing can be done in polynomial time. For some of the cases, the parsing problem is shown to be log-space reducible to context-free string parsing.Parts of the results of this paper were presented at 15th ICALP, [La88b] 相似文献