Optimal design of rural drainage networks