Re: Looking for an algorithm to accomplish the following
- From: Philippe 92 <nospam@xxxxxxxxxxxx>
- Date: Wed, 31 Aug 2005 09:38:26 +0200
fadi wrote :
> Hello all,
>
> Lets say there are N number of sets and each set has the same number of
> attributes as follows:
>
> Set1: W=10, X=15, Y=5, Z=25
> Set2: W=10, X=5, Y=10, Z=20
> Set3: W=10, X=10, Y=20, Z=0
> Set4: W=10, X=30, Y=10, Z=5
>
> Now, to find the sets that if summed, you would get the following values:
>
> Result: W= 20, X=15, Y=30, Z=20
>
> Answer would be Set2 + Set3 of course, but is there an algorithm that I can
> follow that would find this answer for me?
>
> It is really more complicated than this where the desired Result can be off
> by certain factor and would have condition as to which can be added..etc, but
> an algorithm would be a starting point for a software I am writing hopefully.
>
> Thanks!
IMHO you are searching for (binary) values (a,b,c,d)
such that a*Set1 + b*Set2 + c*Set3 + ... = Result
all capital letters beeing vectors.
that is consider the matrix
(10, 15, 5, 25)
M = (10, 5, 10, 20)
(10, 10, 20, 0)
(10, 30, 10, 5)
(a,b,c,d...) * M = (20, 15, 30, 20)
algorithms for computing the inverse (or quasi-inverse) of M
wouldn't help ?
(a,b,c,d...) = (20, 15, 30, 20) * M^(-1)
Regards.
--
philippe
mail : chephip at free dot fr
site : http://chephip.free.fr/
.
- Follow-Ups:
- References:
- Prev by Date: Re: How Were Those Tables Computed?
- Next by Date: Re: Han's startling new set theory.
- 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
|