简体   繁体   English

包含并行性的 Big-O 符号版本?

[英]Version of Big-O notation that includes parallelism?

This question requires some set up.这个问题需要一些设置。

http://igoro.com/archive/big-oh-in-the-parallel-world/ http://igoro.com/archive/big-oh-in-the-parallel-world/

"Method 1" in this link details a notation for describing the effect of parallelism on algorithmic time complexity.此链接中的“方法 1”详细说明了用于描述并行性对算法时间复杂度的影响的符号。 I really like this method of description, but this is the only place I have ever found it.我真的很喜欢这种描述方法,但这是我唯一找到的地方。

My question is as follows: why is this notation not used more often?我的问题如下:为什么不经常使用这种符号?

One explanation is actually given in the method description itself: "To multiply two 100×100 matrices, we would need a machine with a 10,000 processors".方法描述本身实际上给出了一种解释:“要乘以两个 100×100 矩阵,我们需要一台具有 10,000 个处理器的机器”。 This quote seems to suggest that 10,000 processors is totally unreasonable for anyone to expect.这句话似乎暗示 10,000 个处理器对于任何人来说都是完全不合理的。

My rebuttal:我的反驳:

https://en.wikipedia.org/wiki/Manycore_processor https://en.wikipedia.org/wiki/Manycore_processor

The largest super computer in the world right now, Taihu Light, contains a total of 40960*256 = 10485760 cores.目前世界上最大的超级计算机太湖之光总共包含40960*256 = 10485760个内核。 We don't all have access to a super computer like Taihu Light, but with cloud computing continuously gaining popularity, I see no reason why 10,000 core processors and beyond won't be widely available for use in the near future.我们并不是所有人都能接触到像太湖之光这样的超级计算机,但随着云计算的不断普及,我认为没有理由在不久的将来不会广泛使用 10,000 个核心处理器及以上的处理器。 On top of that, the average GPU has 1000s of cores already.最重要的是,平均 GPU 已经有 1000 个内核。 They're more specialized than CPU cores, but that's besides the point.它们比 CPU 内核更专业,但这不是重点。

Since there are so few examples of this notation, I'll also provide my own example using an equivalent description, which I call big money notation.由于这种符号的例子很少,我还将使用等效的描述提供我自己的例子,我称之为大钱符号。

Say we have a perfectly balanced tree with a branching factor of b.假设我们有一个完美平衡的树,其分支因子为 b。 All nodes save one contain a boolean value of false, and the last contains a boolean value of true.所有节点保存一个包含布尔值 false,最后一个包含布尔值 true。 We want to find and return this true node.我们想找到并返回这个真正的节点。

Using a breadth first search, the the Big-O runtime to find the true node would be O(|V|+|E|) == O(b^d), where b is the branching factor and d is the depth of the tree.使用广度优先搜索,查找真正节点的 Big-O 运行时将为 O(|V|+|E|) == O(b^d),其中 b 是分支因子,d 是深度那个树。

However, if we assume that we have infinitely many processing units, each with finite processing capabilities, the big-money notation is as follows: $O(b^d -> d).然而,如果我们假设我们有无限多的处理单元,每个处理单元的处理能力都是有限的,那么大钱符号如下:$O(b^d -> d)。 What this says is that on 1 processor, the algorithm would take O(b^d) time, but as the number of processors increases, the time complexity approaches d, the depth of the tree.这意味着在 1 个处理器上,该算法将花费 O(b^d) 时间,但随着处理器数量的增加,时间复杂度接近 d,即树的深度。 This is because at each false node, we can spawn b more processes to search each of that nodes b children.这是因为在每个假节点上,我们可以产生 b 个更多进程来搜索每个节点 b 个子节点。 Since we have infinite cores, all of these processes can work in parallel.由于我们有无限的内核,所有这些过程都可以并行工作。 This is why I call it big money notation.这就是为什么我称之为大笔货币符号。 Time complexity decreases with more processing power, processing power increases as you throw more money at Amazon/Microsoft/Google/YourFavoriteCloudProvider.时间复杂度随着处理能力的提高而降低,当您在 Amazon/Microsoft/Google/YourFavoriteCloudProvider 上投入更多资金时,处理能力会增加。

I'll reiterate my question again.我会再次重申我的问题。 Why is notation similar to this not seeing more widespread use?为什么与此类似的符号没有得到更广泛的使用? Thanks!谢谢!

The complexity class NC deals with problems that can be solved efficiently in a parallel setting.复杂度类 NC处理可以在并行设置中有效解决的问题。 As far as I know, people who work on parallel algorithms do use the traditional O(.) notation and use expressions like "NC algorithms", so when you read their papers and see sentences like:据我所知,从事并行算法工作的人确实使用传统的O(.)表示法并使用“NC 算法”之类的表达式,因此当您阅读他们的论文并看到如下句子时:

"We give a O(xxx) NC algorithm for SOMEPROBLEM." “我们为 SOMEPROBLEM 提供了一个 O(xxx) NC 算法。”

you should interpret this as:您应该将其解释为:

"We give a parallel algorithm for SOMEPROBLEM which solves it in time O(xxx) using O(yyy) processors." “我们为 SOMEPROBLEM 提供了一种并行算法,该算法使用 O(yyy) 处理器在 O(xxx) 时间内解决它。”

(where xxx and yyy vary of course). (其中 xxx 和 yyy 当然有所不同)。

I don't recall seeing something that resembles your notation, but I'm not sure what it would bring to the table.我不记得看到过与您的符号相似的东西,但我不确定它会带来什么。 Complexity classes are often partitioned according to some parameter and / or some measure of growth of that parameter (eg, we have access to O(1) processors, or O(log n) processors, or ...) so as to classify problems with a degree of precision that your notation seems to lack if I interpret it correctly.复杂性类别通常根据某些参数和/或该参数的某些增长度量进行划分(例如,我们可以使用O(1) 个处理器,或O(log n) 个处理器,或...)以便对问题进行分类如果我正确解释它,你的符号似乎缺乏一定程度的精确度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM