有什么方法可以在不找到所有可能顺序的情况下计算 DAG 中拓扑排序的总数?

Is there any-way to count the total number of topological sort in a DAG without finding the all possible order?

假设这是一个问题.....

如何计算拓扑排序的总数而不查找所有顺序?

总的来说这是 #P-complete。这个 特定的图恰好是 series–parallel, 但是,这很容易。系列图导致的数量 每个图相乘的可能性。对于特定的图 你展示了,一共有三颗钻石,每颗都有两个 有效的扩展名,所以有八种可能性。