Optimization of Freight Rail Transportation