12.07.2015 Views

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The Goal StackTo understand how goals are executed, consider the concept of the goal stack. Every nodehas its own goal stack. When cplex.solve(goal) is called, the goal stack of the rootnode is simply initialized with goal and then the regular cplex.solve method is called.When <strong>ILOG</strong> <strong>CPLEX</strong> processes a node, it pops the first goal from the node's goal stack andcalls method execute. If a nonempty goal is returned, it is simply pushed back on the stack.<strong>ILOG</strong> <strong>CPLEX</strong> keeps doing this until the node becomes inactive or the node's goal stackbecomes empty. When the node stack is empty, <strong>ILOG</strong> <strong>CPLEX</strong> continues with its built-insearch strategy for the subtree rooted at this node.In light of the goal stack, here are the different types of goals:◆ As explained in Or Goal on page 430, the Or goal creates child nodes. <strong>ILOG</strong> <strong>CPLEX</strong>first initializes the goal stack of every child node with a copy of the remaining goal stackof the current node. Then it pushes the goal passed as the argument to the Or goal on thegoal stack of the corresponding node. Finally, the current node is deactivated, and<strong>ILOG</strong> <strong>CPLEX</strong> continues search by picking a new active node from the tree to process.◆◆◆The And goal simply pushes the goals passed as arguments onto the goal stack in reverseorder. Thus, when the goals are popped from the stack for execution, they will beexecuted in the same order as they were passed as arguments to the And goal.When a Fail goal executes, the current node is simply deactivated, and <strong>ILOG</strong> <strong>CPLEX</strong>continues on another active node from the tree. In other words, <strong>ILOG</strong> <strong>CPLEX</strong>discontinues its search below the current node.When a local cut goal is executed, its constraints are added to the node problem as localcuts and the relaxation is re-solved.◆ An empty goal cannot be executed. Thus, empty goals are not pushed onto the goal stack.If the goal stack is empty, <strong>ILOG</strong> <strong>CPLEX</strong> continues with the built-in branching strategy.With this understanding, consider further what really goes on when a goal returnsreturn AndGoal(OrGoal(var = IloFloor(val)+1), this);The And goal is pushed onto the current node's goal stack, only to be immediately poppedback off of it. When it is executed, it will push this on the goal stack and then the Or goal.Thus, the Or goal is the next goal that <strong>ILOG</strong> <strong>CPLEX</strong> pops and executes. The Or goal createstwo subnodes, and initializes their goal stacks with copies of the goal stack of the currentnode. At this point both subnodes will have this on top of their goal stacks. Next, the Orgoal will push a local cut goal for var ≤ val (where val denotes the floor of val) onthe goal stack of the first subnode. Similarly, it pushes a local cut goal for var ≥ val + 1 onthe goal stack of the second subnode. Finally, the current node is deactivated and<strong>ILOG</strong> <strong>CPLEX</strong> continues its search with a new active node from the tree.<strong>ILOG</strong> <strong>CPLEX</strong> <strong>11.0</strong> — USER’ S MANUAL 435

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!