有向无环图中的最大权连通子图

发布于 2024-10-26 05:29:46 字数 201 浏览 9 评论 0原文

我正在研究一个涉及逻辑电路(可以表示为 DAG)的研究问题。 DAG 中的每个节点都有一个给定的权重,该权重可以为负数。我的目标是找到一个连通子图,使得节点权重之和最大。

给定边权重的最大权重连通子图问题显然是 NP 困难的,但我希望的是有向无环性质以及我处理节点权重而不是边权重的事实使问题变得更容易。有人能指出我如何开始解决这个问题的正确方向吗?

谢谢

I am working on a research problem involving logic circuits (which can be represented as DAGs). Each node in the DAG has a given weight, which can be negative. My objective is to find a connected subgraph such that the sum of the node weights is maximal.

The maximum weight connected subgraph problem given edge weights is NP-hard apparently, but what I am hoping is that the directed-acyclic nature and the fact that I am dealing with node weights rather than edge weights makes the problem somewhat easier. Can someone point me in the right direction of how to start attacking this problem?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

四叶草在未来唯美盛开 2024-11-02 05:29:46

你提到的问题是NP-hard问题,请参阅:
“发现分子相互作用网络中的调节和信号传导电路”
作者:Trey Ideker、Owen Ozier、Benno Schwikowski 和 Andrew F. Siegel,
Bioinformatics,第 18 卷,第 233-240 页,2002 年

以及本文的补充信息:
http://prosecco.ucsd.edu/ISMB2002/nph.pdf

the problem you mentioned is NP-hard, see:
“Discovering regulatory and signaling circuits in molecular interaction networks”
by Trey Ideker, Owen Ozier, Benno Schwikowski, and Andrew F. Siegel,
Bioinformatics, Vol 18, p.233-240, 2002

and the supplementary information to this paper:
http://prosecco.ucsd.edu/ISMB2002/nph.pdf

请恋爱 2024-11-02 05:29:46

第一种方法,为每条边分配起始节点权重的倒数,并应用最短路径算法,例如 贝尔曼-福特。 Dijkstra 算法不起作用,因为某些边缘可能为负。

第二种方法,从每个叶节点开始,向每条边添加“标签”,以跟踪所有涉及的节点的 ID 和总权重。无需标记节点,因为对于从叶子开始的每个链,保证每个节点仅被访问一次。例如,给定以下非循环有向图(从上到下有向),其中每个节点权重为 1:

                         A     G
                        / \   /
                       /   \ /
                      B     C
                      |    / \
                      D   E   F
                           \ /
                            H

A 和 B 之间的边将标记为 {{D,B,A},3},A 和 C 之间的边将具有两个标签 {{H,E,C,A},4} 和 {{H,F,C,A},4}。

经过此预处理后,找到每个根节点的最大权重路径。该信息位于其出站边缘的标签中。

First approach, Assign to each edge the inverse of the weight of the starting node, and apply a shortest path algorithm like Bellman-Ford. The Dijkstra's algorithm won't work as some edges can be negative.

Second approach, starting on each leaf node, add "tags" to each edge that keeps track of the ids of all the nodes involved, and the total weight. There is no need to mark the node, as each node is guaranteed to be visited only once for each chain starting on the leafs. For example, given the following Acyclic Directed graph (directed top to bottom) where each node weights 1:

                         A     G
                        / \   /
                       /   \ /
                      B     C
                      |    / \
                      D   E   F
                           \ /
                            H

The edge between A and B will be tagged {{D,B,A},3}, the edge between A and C will have two tags {{H,E,C,A},4} and {{H,F,C,A},4}.

After this pre-procesing, find the greatest weight path for each root node. The information is in the tags of their outbound edges.

心清如水 2024-11-02 05:29:46

您提到连接的连接子图应该是“最大”。为此,贪婪地选择一个顶点并使其增长,直到无法增长为止。这保证了最大化。但是,如果您的意思是“最大”,那么问题可能是 NP_Complete。另外让我提醒您,节点加权图比边加权图更通用。为前者构建的每个算法都适用于后者,但反之亦然。这很容易看出。自己尝试一下。
我对这个问题的理解是,我觉得它在 P 中。如果这是正确的,那么提示就是使用 DAG 的一些特殊属性(自从你研究以来你应该知道这一点,这似乎是一个讲义问题)。对于一般图,这可以简化为斯坦纳树,因此它是 NP-Cmplete(事实上也适用于平面图)。

You mentioned that connected that connected subgraph should be "maximal". For this greedily choose a vertex and grow it until you cannot grow. this assures maximality. However if you mean "maximum" then the problem might be NP_Complete. Also let me remind you that node weighted graphs are more general than edge weighted graphs. Every algorithm built for the former is applicable to later but vice-versa is not always true. This is very easy to see. Try out yourself.
What i understand the problem, i feel it is in P. If that is correct then the Hint for that is to use some special property for DAGs (which u shud know since u r researching and this seems a lecture notes problem). For general graphs, this is reducible to steiner trees so it is NP-Cmplete(infact also for planar graphs).

阳光①夏 2024-11-02 05:29:46

如果给定边权重的最大权重连通子图问题是 NP 难的,我认为你的问题是 NP 难的。您可以将节点权重问题简化为边权重问题。

1)Lets say that your nodes have weights wn1,wn2,wn3,....wnN; where N is # of nodes.

2)Lets also say that the edges can be represented by e1,e2,e3,...eE; E- # of edges.

The weight of the edge ei:nj->nk can be defined as F(wnj,wnk), the function being
arbitrary. For simplicity we can assume wei=wnj+wnk.

Now if we assume that all node weights are independent and non-identical, then we
can say the same about the edge weights. As a DAG with non-identical edge weights
is NP hard, your problem too is. 

Having said that, I think you should proceed in the following way:
1)Look for similarity in node weights for your particular problem. If there are any,
try to look up the literature for similar problems. 

2)If they are hard to find, I suggest you translate your node weight problem to edge 
weight one, and see how the similarity in node weights translates to edge weights
problem and see what simplification can you apply to this problem, again from 
literature.

我希望这有帮助。

I think your problem is NP hard if the maximum weight connected subgraph problem given edge weights is NP hard. You can reduce the node weight problem to the edge weight problem.

1)Lets say that your nodes have weights wn1,wn2,wn3,....wnN; where N is # of nodes.

2)Lets also say that the edges can be represented by e1,e2,e3,...eE; E- # of edges.

The weight of the edge ei:nj->nk can be defined as F(wnj,wnk), the function being
arbitrary. For simplicity we can assume wei=wnj+wnk.

Now if we assume that all node weights are independent and non-identical, then we
can say the same about the edge weights. As a DAG with non-identical edge weights
is NP hard, your problem too is. 

Having said that, I think you should proceed in the following way:
1)Look for similarity in node weights for your particular problem. If there are any,
try to look up the literature for similar problems. 

2)If they are hard to find, I suggest you translate your node weight problem to edge 
weight one, and see how the similarity in node weights translates to edge weights
problem and see what simplification can you apply to this problem, again from 
literature.

I hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文