Network Flow Algorithms for Structured Sparsity