Convex and Network Flow Optimization for Structured Sparsity