Re: Looking for a fast algorithm
- From: Gerry Quinn <gerryq@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 17 Jan 2006 12:52:51 -0000
In article <1137421964.191059.71720@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
frederik_coppens@xxxxxxxxx says...
> Hi,
>
> I have the following problem. I have rows of objects, each if which is
> associated with a number. The rows are of different length. The objects
> on each row are sorted, the objects with the highest numbers come
> first.
> Now, it's possible to make sequences of objects by taking an object
> from every row, and to associate a number with each such sequence by
> multiplying the numbers of every object. It's clear that the sequence
> with the highest number will be the one obtained by taking the first
> object of every row. But how do I find the X highest sequences? (ie the
> X sequences with the highest numbers, where X can be for example 100.)
> It's of course possible with brute force search, but Is there a fast
> algorithm for doing this?
I would say no. This sort of combinatorial problem is inevitably NP.
(It's quite similar to the one posed recently of finding the N shortest
paths on a graph.)
Thre will be no 'key' that allows you to summarise the relevant
combinations. Therefore the number you need to assess will increase
exponentially.
- Gerry Quinn
.
- References:
- Looking for a fast algorithm
- From: frederik_coppens
- Looking for a fast algorithm
- Prev by Date: Re: Technical reason why sizeof() is an operator and not a function?
- Next by Date: Re: Technical reason why sizeof() is an operator and not a function?
- Previous by thread: Re: Looking for a fast algorithm
- Next by thread: c++ float and integer
- Index(es):
Relevant Pages
|