Wiki Link: [discussion:5248]
Shadow Prices by use of SOS2 all zero 

Apr 25 2012 at 8:39 AM
Hello everybody,

I'm new at Solver Foundation and have a Problem! Perhaps anyboddy can help me?

I've got this model:
breakPoints = new List<Break>();
for(int i = 0; i < b.Count(); i++)
{
breakPoints.Add( new Break(2, -bitol, bitol*0.15, i));
breakPoints.Add(new Break(3, 0.0000001, 0.0, i));
breakPoints.Add( new Break(4, bi*tol, 0, i));
}
//Creating the sets

Set J = new Set(Domain.IntegerNonnegative, "J");
Set I = new Set(Domain.IntegerNonnegative, "I");
Set breaks = new Set(Domain.Integer, "Breaks");
//Creating the parameters
Parameter paramDemands = new Parameter(Domain.IntegerNonnegative, "ParamDemands", I);
Parameter paramCosts = new Parameter(Domain.Real, "ParamCosts", J);
Parameter paramP = new Parameter(Domain.Real, "paramP", I, J);

//Set the data for the parameters (data binding)
List<Demand> d = new List<Demand>();
for (int k = 0; k < demand.Count(); k++)
{
d.Add(new Demand(demandk, k));
}
paramP.SetBinding(pp);
paramDemands.SetBinding(d, "value", "key");
paramCosts.SetBinding(costs);

//Add parameters to model
masterModel.AddParameters(paramDemands, paramP, paramCosts);


//parameter for SOS
Parameter paramRCoord = new Parameter(Domain.Real, "RCoordinate", I, breaks);
Parameter paramFCoord = new Parameter(Domain.Real, "FCoordinate", I, breaks);
paramRCoord.SetBinding(breakPoints, "RCoordinate", "Count", "Id");
paramFCoord.SetBinding(breakPoints, "FCoordinate", "Count", "Id");
masterModel.AddParameters(paramFCoord, paramRCoord);

//Creating, bind data and add decision to the model
Decision decisionx = new Decision(Domain.RealNonnegative , "Decisionx", J );
Decision decisiony = new Decision(Domain.RealRange(0,1), "Decisiony", I, breaks);

masterModel.AddDecisions(decisionx, decisiony);

//Adding the constraint

masterModel.AddConstraint("demandConstraint", Model.ForEach
(
I, i =>
Model.Sos2(
Model.Sum
(
Model.ForEach
(
J, j =>
decisionxj * paramPi, j
)
) - paramDemandsi
== Model.Sum(Model.ForEach(breaks, point => paramRCoordi, point * decisionyi, point)))
)
);


//Minize the total rolls
masterModel.AddGoal("CuttingStock", GoalKind.Minimize, Model.Sum(Model.ForEach(J, j => paramCostsjdecisionxj)) + Model.Sum(Model.ForEach(I, i => Model.Sum(Model.ForEach(breaks, point => decisionyi, pointparamFCoordi, point)))));



If I solve the model then I get a lots of ShadowPrices according to the constraint demandconstraint:
demandconstraint(0); demandconstraint(0)#1; demandconstraint(0)#2; demandconstraint(0)#3; demandconstraint(0)#4;demandconstraint(0)#5;
demandconstraint(1); demandconstraint(1)#1;...

I thought the ones without #number are the one corresponding to the dual variables and to use in a Column Generation, but they are all zero!!!
So what I am doing wrong?
Am I missing something?

Thanks for any help!


Updating...
Page view tracker