1. A method of generating a directed graph representing an auction problem having I items and S counterparties, each item being subdivided into Q units, with a plurality of bids, each bid being a bid B is (q s ) representing the cost of q s units of item i with counterparty s where i may be any element of {1, 2. .. I}, and s may be any element of {1, 2,. .. S}; the method comprising: generating a source vertex and a sink vertex; generating a plurality of intermediate vertices (i,s,q) for each item i where i=1, 2,. .. I, for each counterparty s where s=1, 2,. .. S, and for each possible quantity q where q=0, 1,. .. Q, wherein when s=S q=Q; generating edges representing each bid, each edge being an ordered edge from a vertex towards the vertex (i, s, q) of length B is (q s ) representing the cost of a quantity q s of item i by counterparty s where q is the total quantity of units of item i supplied by counterparties from counterparty 1 up to and including counterparty s so that there are a plurality of paths along the ordered edges from the source vertex to the sink vertex via intermediate vertices; and storing the directed graph on a computer readable medium as a model of the auction problem for solving the auction problem.