Re: Looking for an algorithm to accomplish the following
- From: "fadi" <fadi@xxxxxxxxxx>
- Date: Wed, 31 Aug 2005 15:05:59 GMT
There are indeed N sets and 1 result set. You can sum more than 2 sets to
get the results. Going by the total as you suggested may not work since you
may have two sets that have the same values but they are in reversed
positions (X=5, Y=7) and (X=7, Y=5) <-- simplified for clarity.
Now the elimination concept will work to an extent, but it will still leave
large number of sets to iterate.
"kendo" <Kendo.Zhang@xxxxxxxxx> wrote in message
news:1125468493.591862.64670@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>I hope it might be useful.
> There are N sets and 1 result set.
> Sum the attributes like this.
> sum the rows.
> entries sets:
> 10 15 5 25 55
> 10 5 10 20 45
> 10 10 20 0 40
> 10 30 10 5 55
> result set:
> 20 15 30 20 85
>
> Now the algorithm will really depend on the general behaviour of data.
> 1.
> If the first attribut is always 10, then the first attribut of the
> result set give us a clue
> about the number of sets that we need to add. 20 means 2 sets. Then we
> will try to
> find TWO numbers in the right most column which add up to 85.
> 2.
> If the number of attributes are really weird, like 3.1416442 or
> 6.842555 etc. and it will be much easier... what are the odds that the
> row sums will coincide with these kinds of attributes?
> if the row sum of entries are :
> 10.2599588
> 9.58745555
> 88.5456688
> 3.21158788
> ....
>
> Not a lot of these sums can add up to a result sum like 125.8499972
> Maybe you still need a complet enumeration here.
> 3.
> and maybe you can do a little tricks to eliminate certain rows, like
> the last attribute of first entry is 25 but the last attribute of
> result set is 20. There is no way 25 can add up to 20. It might be
> useful if you have a large database and it is just not worth it to
> wasting time to consider these entries.
> 4.
> so maybe you can conclude the number of sets we need by doing this:
> find the maximal sum and the minimal sum using only two sets.
> Like the two biggest sets(bigger means the ROW SUM is bigger) add
> together, the sum of these sets' row sum is still smaller than the row
> sum of result set, you will know that more than 2 sets are needed. By
> the same methode, you can find the Min. if the row sum of result set is
> smaller than the min sum of 4 sets. then we know that 3 sets are
> required.
>
> When you found some rows which sum is equal to the row sum of result
> set, then you can check attribute by attribute.
>
.
- References:
- Prev by Date: Re: Multiplicative Seminorms
- Next by Date: Re: infinity
- Previous by thread: Re: Looking for an algorithm to accomplish the following
- Next by thread: Re: Looking for an algorithm to accomplish the following
- Index(es):
Relevant Pages
|