ENH: Added ability to switch on the sparse cost function on a per-network basis.