I'm assuming each person starts with 0 apples.

A less creative solution for your above example with the same number of steps is:

B gives A 250 (A at 250, B at -250)

C gives B 120 (B at -130, C at -120)

D gives C 420 (C at 300, D at -420)

E gives D 320 (D at -100, E at -320)

F gives E 340 (E at 20, F at -340)

Proceeding inductively, it can be shown that given n people with 0 apples can be rearranged to have the above requirement which totals 0 (n-1) trades isasolution. To prove that it is the least amount of trades, suppose that any Ending Requirement can be yielded with (n-2) trades instead. Let n=2; it's obvious that end result A 1 B -1 cannot happen with 2-2=0 trades, so we have a contradiction. Hence the smallest number of trades possible to get the required result is (n-1)

EDIT: the quantity of each trade will be (projected value - current value) of the receiver after each trade.