[gecode-users] Re: Waiting for stability
Luis Quesada
luque at info.ucl.ac.be
Thu Jun 15 15:02:01 CEST 2006
Dear all,
I am trying to use LinExpr in order to implement a (naive) order
propagator for graph variables.
Is the following use of LinExpr correct?
template <class SPACE>
LinExpr
graph_order(SPACE* space, OutAdjSetsGraphView g){
OutAdjSetsGraphView::LubNodeIterator g_ub = g.iter_nodes_UB();
LinExpr Sum(IntVar(space,0,0));
for (;g_ub();++g_ub){
int n=g_ub.val();
BoolVar a(space,0,1);
dom(space, g.nodes, SRT_SUP, n, a);
LinExpr BoolVarLinExpr(a);
Sum=LinExpr(Sum,BoolVarLinExpr,1);
}
return Sum;
}
In order to post the constraint, what I am doing is the following:
LinExpr SumBoolVars(graph_order(this,fg));
LinRel Order(SumBoolVars,IRT_LQ,fg_lubOrder);
Order.post(this,true,ICL_DOM);
Where fg_lubOrde is an integer.
However, it seems I am doing something wrong since there is no
propagation taking place.
Thanks in advance for your answer,
Luis
More information about the gecode-users
mailing list