Suppose you have a set of nodes. Some nodes are producers, some are consumers, and some are routers. Each node has a maximum throughput which defines the maximum number of units it can accept per day, and also the maximum number of units it can send per day (in this case accepts and sends do not interfere with each other). Each node also has a storage capacity for units, allowing them to deal with variations in flow. Also, each node may only be out-connected with up to 8 nearby nodes (on a plane), and the same limit applies to in-connections.
I already have a heuristic which, given a graph, enumerates the nodes and does a good-enough job pushing units to following nodes. It enumerates each node, sending max(ceil(remaining-sendable-units/remaining-following-nodes), remaining-receivable-units-at-receiver) to each target node.
Now I need a way to automatically look at a node, and decide what the graph topology should be in order for good-enough flow. My basic idea was to assign a 'responsibility' to each node, initially equivalent to how many units they consumed. Then adding an edge from n1 to n2 would give some of n2's responsibility to n1. But I quickly found that the difference between the amount a node could consume and the amount a node could accept confused the algorithm and led me in circles.
edit The amount consumed by each producer/consumer can vary over time (below some maximum) and nodes can be added or removed.
Any simple ideas?