30.01.2015 Views

ILOG CPLEX C++ API 9.0 Reference Manual

ILOG CPLEX C++ API 9.0 Reference Manual

ILOG CPLEX C++ API 9.0 Reference Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

IloCplex::BranchCallbackI<br />

◆<br />

The parameter data allows you to add an object of type<br />

IloCplex::MIPCallbackI::NodeData to the node representing the branch<br />

created by the makeBranch call. Such data objects must be instances of a userwritten<br />

subclass of IloCplex::MIPCallbackI::NodeData.<br />

protected NodeId makeBranch(const IloNumVarArray vars,<br />

const IloNumArray bounds,<br />

const IloCplex::BranchDirectionArray dirs,<br />

IloNum objestimate,<br />

NodeData * data)<br />

This method overrides the branch chosen by an instance of IloCplex. A method<br />

named makeBranch can be called zero, one, or two times in every invocation of the<br />

branch callback. If you call it once, it creates one node; it you call it twice, it creates two<br />

nodes (one node at each call). If you call it more than twice, it throws an exception.<br />

Each call specifies a branch; in other words, it instructs the invoking IloCplex object<br />

how to create a subnode from the current node by specifying new, tighter bounds for a<br />

set of variables.<br />

◆<br />

◆<br />

The parameter vars contains the variables for which new bounds will be set in the<br />

branch.<br />

The parameter bounds contains the new bounds for the variables listed in vars;<br />

that is, bounds[j] is the new bound to be set for vars[j].<br />

◆ The parameter dirs indicates the branching direction for the variables in vars.<br />

dir[j] == IloCplex::BranchUp<br />

means that bounds[j] specifies a lower bound for vars[j].<br />

dirs[j] == IloCplex::BranchDown<br />

means that bounds[j] specifies an upper bound for vars[j].<br />

◆<br />

◆<br />

The parameter objestimate provides an estimate of the resulting optimal<br />

objective value for the subnode specified by this branch. The invoking instance of<br />

IloCplex may use this estimate to select nodes to process. Providing a wrong<br />

estimate will not influence the correctness of he solution, but it may influence<br />

performance. Using the objective value of the current node is usually a safe choice.<br />

The parameter data allows you to add an object of type<br />

IloCplex::MIPCallbackI::NodeData to the node representing the branch<br />

created by the makeBranch call. Such data objects must be instances of a userwritten<br />

subclass of IloCplex::MIPCallbackI::NodeData.<br />

protected void prune()<br />

By calling this method, you instruct the <strong>CPLEX</strong> branch & cut search not to create any<br />

child nodes from the current node, or, in other words, to discard nodes below the current<br />

node; it does not revisit the discarded nodes below the current node. In short, it creates<br />

<strong>ILOG</strong> <strong>CPLEX</strong> <strong>C++</strong> <strong>API</strong> <strong>9.0</strong> REFERENCE M ANUAL 91

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

Saved successfully!

Ooh no, something went wrong!