
DAG数据结构跟踪基本块中值和变量的计算和赋值 ;块中使用的来自别处的值表示为叶子结点 来自;值上的操作表示为内部结点 ;新值的赋值表示为将目标变量或临时变量的名字附加到表示赋值的结点上。
- 中文名 dag图
- 外文名 Directed Acyclic Graph
- 介绍 无回路有向图
- 编译原理DAG 有向无环图
基本简介
蛋哥再备金娘DAG图:无回路有向图(Directed Acyclic Graph)
DAG 上的问题
SPOJ 4882 Coun用注市言住色报ting in a DAG
点带权DAG 求每个点能到达的点集的权值之和(包括自己)
编译原理中的DAG:
有向无环图;
基本块的有向无环图(DGA):
拓展:基本块划分,主要依据流图构造,就是按照if,while等跳转时需要的lab位置划分。例如:
label L2t2=fact*xfact=t2t3=x-1x=t3t4=x==0if_false t4 goto L2
来自其DAG为:
在数学和计算机科学的,有向无环图(DAG,/ˈdaelig; ɡ/), is a directed graphwith no directed cy360百科cles. 是一个有向图,无定向的周期。That is, it is formed by a collection of vertices and directed edges, each edg应e connecting on军上杂超想e vertex t怀承硫o another, such t破概效树手黑hat there is no way to start at some vertex v and follow a sequence of edges th族at eventually loo做祖管助外测定源章垂ps back to v again. [ 1 ][ 2 ][ 3 ]也就是说,它是由集合的顶点和有向边构成,每条边连接一个顶点到另一个,这样,在一些顶点v开始,沿着有序的边,最终循环回再次到V是不可能的。[ 1][2][3]

DAGs may b封女岁社来兰复英者e used to model several different kinds of structure in mathematics and computer science.的DAG可用于对数学和计算机科学中得一些不同种类的结构进行建模。A colle陆渐北室际权继慢ction of tasks 香端解之唱期军that must be ordered into a sequence, subject to constraints that certain tasks must be performed earlier than others, may be represented as a DAG with a vertex for each task and an edge for each constraint; algorithms for topological orderingmay be used to generate a valid sequence,由于受制于某些任务必须比另一些任务较早执行的限制,必须排序为一个队列的任务仅怕那集合可以由一个DAG图来呈现,院后换境任掌动侵一慢拿其中每个顶点表示一个任务,每条边表示一种限制约束,拓扑排序算法可以用来生成一个有效的序列。DAGs may also be used to model processes in which information flows in a consistent direction through a network of processors.DAG也可以用来模拟信息沿着一个一致性的方向通过处理器书艺干经娘经网络的过程。The reachabilityrelation in a DAG forms a partial order, and any finite partial order may be represented by a DAG using r存立步米吗决气征eachability.DAG中得可站们读超治色亚久单季达性关系构成了一个局部顺序,任何有限的局部顺序可以由DAG使用可达性来呈现,Additionally, DAGs may be used as a space-efficient representation of a coll套但套乎论亮标或ection of sequences with overlapping subsequences.此外,DAG的可作为一个序列集合的高效利用空间的重叠的子序列的代表性。
The corresponding c势oncept for undirected graphsis a forest, an undirected graph without cycles.相对应的概念,无向图是一个森林,无环的无向图。 Choosing an orientation for a forest produces a special kind of directed acyclic graph called a polytree.选择森林的一个方向,产生了一种特殊的有向无环图称为polytree 。 However there are many other kinds of directed acyclic graph that are not formed by orienting the edges of an undirected acyclic graph.不过,也有其他种类的向无环图,它们不是由面向无向无环图的边构成的。For this reason it may be more accurate to call directed acyclic graphs acyclic directed graphs or acyclic digraphs .出于这个原因,称其为有向无环图比无环有向图或者无环图更确切。
评论留言