A method of distributing a resource through a network, the resource being electrical power, the network comprising a plurality of consumer units (C1-C4) and a plurality of producer units (P1-P6), each consumer unit (C1-C4) being directly connected to one or more producer units (P1-P6) in the network by a single electrical energy or power flow, such that that consumer unit (C1-C4) may receive the resource from each producer unit (P1-P6) to which it is directly connected, each consumer unit (C1-C4) being a user of the resource and being associated with a desired resource amount, each producer unit (P1-P6) being a producer of the resource and being associated with a resource production limit and associated with a resource cost, the method comprising: performing one or more times a first process, the first process being a process of performing step (a) followed by step (b); wherein step (a) comprises selecting at random a previously unselected consumer unit (C1-C4) from the plurality of consumer units (C1-C4), thereby providing a currently selected consumer unit; step (b) comprises performing one or more times a second process, the second process being a process of performing (c) followed by steps (d), (e), (f) and (g); step (c) comprises selecting, by the currently selected consumer unit, a producer unit (P1-P6) from the plurality of producer units (P1-P6) that is previously unselected by the currently selected consumer unit thereby providing a currently selected producer unit, the currently selected producer unit being directly connected in the network to the currently selected consumer unit by a single electrical energy or power flow and being associated with a lowest cost of the costs associated with the previously unselected producer units (P1-P6) directly connected in the network to the currently selected consumer unit (C1-C4); step (d) comprises, from the currently selected producer unit to the currently selected consumer unit, delivering an amount of resource, the amount of resource being substantially equal to a minimum of a first value and a second value; the first value is the resource production limit associated with the currently selected producer unit; and the second value is a difference between desired resource amount associated with the currently selected consumer unit and a total amount of resource previously delivered to the currently selected consumer unit; step (e) comprises, by the currently selected consumer unit, reducing the desired resource amount associated with the currently selected consumer unit by the amount of resource delivered, thereby generating a new second value; step (f) comprises, by the currently selected producer unit, reducing the first value for that producer unit by the amount of resource delivered, thereby generating a new first value; and step (g) comprises determining whether the desired resource amount is equal to zero, wherein if the desired resource amount is not equal to zero, the method comprises repeating step (b) using the new first value and new second value, and wherein if the desired resource amount is equal to zero, the method comprises repeating step (a). performing one or more times a first process, the first process being a process of performing step (a) followed by step (b); wherein step (a) comprises selecting at random a previously unselected consumer unit (C1-C4) from the plurality of consumer units (C1-C4), thereby providing a currently selected consumer unit; step (b) comprises performing one or more times a second process, the second process being a process of performing (c) followed by steps (d), (e), (f) and (g); step (c) comprises selecting, by the currently selected consumer unit, a producer unit (P1-P6) from the plurality of producer units (P1-P6) that is previously unselected by the currently selected consumer unit thereby providing a currently selected producer unit, the currently selected producer unit being directly connected in the network to the currently selected consumer unit by a single electrical energy or power flow and being associated with a lowest cost of the costs associated with the previously unselected producer units (P1-P6) directly connected in the network to the currently selected consumer unit (C1-C4); step (d) comprises, from the currently selected producer unit to the currently selected consumer unit, delivering an amount of resource, the amount of resource being substantially equal to a minimum of a first value and a second value; the first value is the resource production limit associated with the currently selected producer unit; and the second value is a difference between desired resource amount associated with the currently selected consumer unit and a total amount of resource previously delivered to the currently selected consumer unit; step (e) comprises, by the currently selected consumer unit, reducing the desired resource amount associated with the currently selected consumer unit by the amount of resource delivered, thereby generating a new second value; step (f) comprises, by the currently selected producer unit, reducing the first value for that producer unit by the amount of resource delivered, thereby generating a new first value; and step (g) comprises determining whether the desired resource amount is equal to zero, wherein if the desired resource amount is not equal to zero, the method comprises repeating step (b) using the new first value and new second value, and wherein if the desired resource amount is equal to zero, the method comprises repeating step (a).