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 Bis (qs) representing the cost of qs units of item i with counterparty s where i may be any element of {1, 2,. .. l}, 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,. .. l, 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, by executing a module stored on a non-transitory computer readable medium, edges representing each bid, each edge being an ordered edge from the source vertex or one of the intermediate vertices towards the vertex (i, s, q) of length Bis (qs) representing the cost of a quantity qs 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 as a model of the auction problem for solving the auction problem.