[algogeeks] Re: How to select top 100 from one million numbers.

2006-11-12 Thread xiaohuamao
A fibonacci heap may be better than a binary heap, whose insert operation is O(1), and the deletemin operation is O(n) for the first time but O(logn) for the rest --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Al

[algogeeks] Re: NP complete Partition problem.

2006-11-12 Thread Pradeep Muthukrishnan
How do u say that it has only O(k|S|) partitions? I thought it was splitting an n element set into k different subsets which is the stirling number of the second kind? Let me know if I am wrong.regards,Pradeep On 11/12/06, Gene <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] wrote:> Can someone please

[algogeeks] Re: NP complete Partition problem.

2006-11-12 Thread Gene
[EMAIL PROTECTED] wrote: > Can someone please give me a algorithm/pseudo code for the following > problem? > > Given an arrangement S of non-negative numbers {s1,s2,s3sn} and an > integer k. > Partition S into k ranges, so as to minimize the maximum sum over all > the ranges. > > e.g Optimall

[algogeeks] Re: Least Lost Selection Problem

2006-11-12 Thread xiaohuamao
Thank you for your reply. But it is hard to say which fruit is "required". As, for example, an apple makes Allen happy, but if there is no apple, a banana may also does. Each person may have may combinations of fruits which make them happy. There are many choices with different cost for a people,

[algogeeks] Graph Partitioning

2006-11-12 Thread Karthik Singaram L
Hi, I have been faced with this problem for weeks and could not find a good solution. can someone help? Given a graph whose nodes are bit vectors of length "n" (the graph contains all 2^n nodes), the edges are defined to be connecting all the pairs of nodes which differ only at one bit positi

[algogeeks] Re: NP complete Partition problem.

2006-11-12 Thread Karthik Singaram L
I am not sure but an arbit way to do this would be to find (totalsum/k) and do a bin packing for each of these , of course we would be left with a few elements, we can put them in the bins with max.slack space...It would be approximately correct I guess though not sure. Hope it helps karthik On