Direct-Recycle Networks: An Algebraic Approach