由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
CS版 - DAG question
相关主题
问graph问题一个大数据 处理问题
Re: 请教一个 graph connectivity 的问题请教:用google analytics 分析网站访问流量 (转载)
一道graph的问题求教!(from MIT Intro to Algo)求教一个算法题.
请问一个图的分解问题问:关于调用节点和cpu数目的关系,谢谢 (转载)
A probability probelm about graph (network)有人set up过 多个node的Cassandra 么?
算法问题请推荐data structure的书
mind execise求教:data structure 经典入门书籍
data structure for set of path in a graph (转载)帮忙下载一篇paper
相关话题的讨论汇总
话题: dag话题: edges话题: structure话题: complexity话题: nodes
进入CS版参与讨论
1 (共1页)
h**********c
发帖数: 4120
1
Consider a DAG as a tree structure, maybe multiple root, even not connected,
(I don't if it is not connected, is it still DAG).
So, treat it like a tree. DAG has n nodes. We have all the nodes' references
. Each node has the storage of its parents ( immediate nodes where directed
edges are from). Each node also has the storage of its children ( immediate
nodes where the directed edges are toward).
The question is if we want to store the DAG with such a structure, what will
be the space complexity of node references?
Or DAG has other storage structure and the space complexity?
c****p
发帖数: 6474
2
相当于问DAG的度?best case O(1) (全不相连),worst case O(n^2)(全相连)

connected,
references
directed
immediate
will

【在 h**********c 的大作中提到】
: Consider a DAG as a tree structure, maybe multiple root, even not connected,
: (I don't if it is not connected, is it still DAG).
: So, treat it like a tree. DAG has n nodes. We have all the nodes' references
: . Each node has the storage of its parents ( immediate nodes where directed
: edges are from). Each node also has the storage of its children ( immediate
: nodes where the directed edges are toward).
: The question is if we want to store the DAG with such a structure, what will
: be the space complexity of node references?
: Or DAG has other storage structure and the space complexity?

h**********c
发帖数: 4120
3
用连通性来考虑,解释的比较清晰,
n^2 是肯定的了,
如果排除重复边,
n^2的full connection,是不是cycle了?
c****p
发帖数: 6474
4
不是重复边。
假设有一个全连通的无向图,就是n(n-1)/2 = O(n^2)条边。
然后把这些无向边变成有向边,变换方法如下:
把节点按1...n编号,则任何一条连接(不妨设uv的有向边。
边的数目不变,且没有cycle,即不可能存在一个当u>v时,u->v的通路。
而且每个结点都要保存子链接和父链接,所以实际算链接的数目时其实可以不考虑边的
方向性。【 在 heteroclinic (asymptotically stable) 的大作中提到: 】
h**********c
发帖数: 4120
5
把O(n^2) 当成n^2 条边了,
thanks

【在 c****p 的大作中提到】
: 不是重复边。
: 假设有一个全连通的无向图,就是n(n-1)/2 = O(n^2)条边。
: 然后把这些无向边变成有向边,变换方法如下:
: 把节点按1...n编号,则任何一条连接(不妨设uv的有向边。
: 边的数目不变,且没有cycle,即不可能存在一个当u>v时,u->v的通路。
: 而且每个结点都要保存子链接和父链接,所以实际算链接的数目时其实可以不考虑边的
: 方向性。【 在 heteroclinic (asymptotically stable) 的大作中提到: 】

h**********c
发帖数: 4120
6
A small debrief of DAG
For the DAG storage structure at post 1, the space complexity could be O(n^2
), given n the number of vertices the graph. So in the geometrical point of
view, such structure is awful. We may say one thousand and three thousand
don't differ too much. But one thousand differ scarily from one million. The
difference is O(n), O(n log n) and O (n^2).
But if we think in the topological way, that is, we observe the space
complexity of this structure in relation to the number of edges of DAG. The
result could be quite optimistic. Given number of edges m, the space
complexity is O(m), because for all the vertices, they can be stored at most
twice.
So the space complexity of such DAG structure is rather decided by the
number of edges. But we also see for DAG, the number of edges can never
exceed n^2, given no repeated edges.

connected,
references
directed
immediate
will

【在 h**********c 的大作中提到】
: Consider a DAG as a tree structure, maybe multiple root, even not connected,
: (I don't if it is not connected, is it still DAG).
: So, treat it like a tree. DAG has n nodes. We have all the nodes' references
: . Each node has the storage of its parents ( immediate nodes where directed
: edges are from). Each node also has the storage of its children ( immediate
: nodes where the directed edges are toward).
: The question is if we want to store the DAG with such a structure, what will
: be the space complexity of node references?
: Or DAG has other storage structure and the space complexity?

1 (共1页)
进入CS版参与讨论
相关主题
帮忙下载一篇paperA probability probelm about graph (network)
有没有啥好点的DAG的clustering 的算法啊?算法问题
AI领域是不是很长时间没有进展了mind execise
这个问题怎么做好?(word sqaure)data structure for set of path in a graph (转载)
问graph问题一个大数据 处理问题
Re: 请教一个 graph connectivity 的问题请教:用google analytics 分析网站访问流量 (转载)
一道graph的问题求教!(from MIT Intro to Algo)求教一个算法题.
请问一个图的分解问题问:关于调用节点和cpu数目的关系,谢谢 (转载)
相关话题的讨论汇总
话题: dag话题: edges话题: structure话题: complexity话题: nodes