Optimization of costs for procurement and transportation of pipes