Re: Help in SQL to balance the values ... ?

From: Nova <nova1427_at_gmail.com>
Date: Mon, 24 Dec 2012 06:13:13 -0800 (PST)
Message-ID: <e795ddb3-56ab-468e-a100-ed41ae5ec778_at_googlegroups.com>



On Monday, December 24, 2012 2:48:40 PM UTC+3, Robert Klemme wrote:
> On 12/24/2012 09:52 AM, Nova wrote:
>
>
>
> > I know it is difficult to explain, the idea is I have F that have
>
> > amount and I have M that have capacity, I want distribute the amount
>
> > to capacity depend on the links. I write the logic by subtract the
>
> > amount from capacity, in the last I have 10 capacity in M3 not used.
>
> >
>
> > I hope it clear.
>
>
>
> Not really. Are you talking about
>
> http://en.wikipedia.org/wiki/Knapsack_problem ?
>
>
>
> Cheers
>
>
>
> robert

Sorry again.

I make easier example and I draw it in a paper

give in info as following:
in table F_LINKTO_M
F M



F1 M1
F2 M1
F2 M2

in table F_V
F F_V



F1 100
F2 70

in table M_V
M M_V



M1 150
M2 45

explain to solve it:
https://dl.dropbox.com/u/64041543/20121224.JPG

In conclusion (Final Result)

F1 = 0  remaining
F2 = 0  remaining
M1 = 0  empty
M2 = 15 empty

Regards;
Tareq Received on Mon Dec 24 2012 - 15:13:13 CET

Original text of this message