As a general rule, all sectors that produce a commodity must be upstream from those that consume the commodity
In other words, the producing sectors need to be lower priority (i.e. higher priority number) than the consuming sectors, so that the producing sectors are solved after the consuming sectors
In addition, no commodity should be consumed and produced by the same sector