# Need help for multicommodity flow problem

 1 Hi, our company sells software for the footwear retail. We try to realize a module for optimizing the transport between the outlets. The stores receive demands on shoes that are not in stock and must be transported from other stores. I started with lpsolve55 and set formulas. Unfortunately, the transport costs depend not directly on the amount. They are either constant or increase when the amount exceeds a certain value (eg because the second truck is needed). I need some help in formulating the objective function and translating it in lpsolve55 or R. So far, I have: $$objective function min \sum f(c_{i,j}, T_{i,j,k}) \sum_{j,k} T_{i,j,k} \leq S_i for i = 1..n, j = 1..n \sum_{i,k} T_{i,j,k} \eq D_j for i = 1..n, j = 1..n S_i = stock in store i D_j = demand in store j T_[i,j,k} = amount to move commodity k from store i to store j c_{i,j} = constant cost for transport between i and j$$ asked 14 Jul '15, 02:23 Gabriel 21●5 accept rate: 0% This is a very interesting problem. In my opinion it is worth to consult it with Prof. Dr. Marco Luebecke from Aachen. It is only 180 km from Bergkamen (ETHOS Gmbh headquarters). Companies need knowledge, and universities value the cooperation with the economic environment. I think it's a good idea. Maybe this will be the beginning of a successful collaboration. (14 Jul '15, 04:12) Slavko

 2 Truck-load (as opposed to less-than-truckload) shipping typically has a step function for cost. You can model a step function in a mixed integer linear program using one binary variable for each possible number of loads (for each shipment), with a constraint that the binary variables for a given shipment must sum to 1 (i.e., exactly one number of loads must be selected for that shipment). answered 14 Jul '15, 14:53 Paul Rubin ♦♦ 14.6k●5●13 accept rate: 19% I've tried to use binary variables to lpsolve55 (intially ignoring changing of cost) and it seems to work. (15 Jul '15, 04:55) Gabriel I was wrong - it is not possible to write in lpsolve55: min: c12 x12 + c13 x13 + c14 x14 + c21 x21 + c23 x23 ...; where c12 is cost from 1 to 2 and x12 ist binary variable for transfer from 1 to 2. Also constraints in form x12 t12 + x13 t13 <= # are not possible. I'm still at the same point - how to define my problem in lp file format. (17 Jul '15, 06:22) Gabriel Since lpsolve is a MILP solver, there should be nothing stopping you from using linear combinations of constants and binary variables. I don't know their file format, but I imagine you can find some examples of lpsolve files involving integer variables somewhere on the web. (17 Jul '15, 11:45) Paul Rubin ♦♦
 toggle preview community wiki

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "Title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Tags: