[BCP] Multicommodity flow problem

Ashwin ashwin at ufl.edu
Mon Apr 13 13:36:17 EDT 2009


Hello,
I have this question about the example for multicommodity flow 
problem provided in BCP.
The feasibility test was performed in the function 
test_feasibility(...) and it has the following piece of code.

const double* x = lpres.x();
    for (i = vars.size()-1; i >= 0; --i) {
        MCF1_var* v = dynamic_cast<MCF1_var*>(vars[i]);
        if (!v) continue;
        std::map<int,double>& f = flows[v->commodity];
        const int vsize = v->flow.getNumElements();
        const int* vind = v->flow.getIndices();
        const double* vval = v->flow.getElements();
        for (j = 0; j < vsize; ++j) {
            f[vind[j]] += vval[j]*x[i];
        }
    }

Later the value of variable "flows" is checked for integer values. 
Does this mean that it is possible to have fractional x values (x 
being the variable in the formulation)?


Thanks in advance.
Best,
Ashwin






More information about the BCP mailing list