English 中文(简体)
图:图表
原标题:Graph Theory: Splitting a Graph

我有这个问题。 我有一张 n子,我想分成两个小子,即X节点和N-x节点,但必须限制剩余的对口数目最大化(或尽量减少被切割的对口数目)。

不清楚这是否有意义。 不是理论人,而是我的问题的抽象版本。 我应研究哪些算法可能有助于我?

这是一个家庭工作问题。 我认为,令人感兴趣的问题!

我计划在C执行。

最佳回答
问题回答

也许先深入搜查点。 我们当时指定一个点,并计算迄今削减的数量。 如果这一数目超过了最佳解决办法的数目,那么我们就放弃了这一数目,背后了轨道。

  1. Given the full set of nodes S, let P and P be setsuts of nodes, initially empty, and K by the number of cut edges, initially 0.
  2. Let S*, K* be the best known solution and its number of cut edges, with K* initially infinity.
  3. Pick a node N to start with and assign it to S.
  4. For each unassigned node M:
    1. Assign M to S , and add the number of edges from M to nodes in S to K.
    2. If K > K*, then no solution based on this one will beat the best, so assign M to S.
    3. If |S| > X, then the set has grown too big; backtrack.
    4. Otherwise, recurse from 4.
  5. If all nodes are assigned and K < K*, then let S* = S and K* = K.

我先把这一算法作为道歉式算法,但用C.1n的算法做得太困难。 绕过正义意味着不转让最后分配的 no。

基本上,你正在研究经修改的刑事诉讼问题。

One way would be to modify karger s algorythm In Karger s algo you contract vertices along random edges until you end up with only two vertices, the remaining edges represent the cut. Since it s random you just do this many times and keep the solution with the least edges in the cut.

在经过修改的版本中,一旦vert倒,你可以停止 coll跃和 count边(如果是你的话,那就算不了),就会有适当的时间,而且你可以找到解决办法。 欺骗性部分是多少次重复计算,以增加信心,达到令人满意的限制。





相关问题
How to add/merge several Big O s into one

If I have an algorithm which is comprised of (let s say) three sub-algorithms, all with different O() characteristics, e.g.: algorithm A: O(n) algorithm B: O(log(n)) algorithm C: O(n log(n)) How do ...

Grokking Timsort

There s a (relatively) new sort on the block called Timsort. It s been used as Python s list.sort, and is now going to be the new Array.sort in Java 7. There s some documentation and a tiny Wikipedia ...

Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

Enumerating All Minimal Directed Cycles Of A Directed Graph

I have a directed graph and my problem is to enumerate all the minimal (cycles that cannot be constructed as the union of other cycles) directed cycles of this graph. This is different from what the ...

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签