Branching mechanism in B&P using SCIP - scip

I'm implementing a branch and price algorithm in c using SCIP.
Question: To call the branching mechanism, I use the basic BRANCHEXECLP mechanism. How does SCIP know when to branch? When the current relaxation solution has non-integer solutions, right? I don't have to tell SCIP to invoked the branching mechanism for this case, right?
I'm asking because (for the most part) my B&P algorithm is working well. But, at some point it reaches a node corresponding to the dual bound solution. After solving the pricing problem (and no columns are attractive to enter the master problem), the relaxation solution at this node contains non-integer solutions, but the branching mechanism is not invoked. The run just quits. Any idea as to what is going on here?
Thanks,
Rob Curry

I guess you checked during pricing that there are fractional variables in the current LP solution?
And the dual bound at that node equals the global dual bound? Did you mark your objective to only have integral values? In that case, if the dual bound is close enough to the primal bound that rounding it up gives the same number, SCIP will just cut off the node. Perhaps also SCIP found a new solution after your pricing which was immediately proven to be optimal by the current global dual bound? SCIP automatically runs some simple rounding heuristics after each solved LP in the pricing loop.

Related

Choosing Barrier for VRP

I'm solving the VRP with Scip and want to choose the algorithm. In some of my instances, Scip solves the problem without the branch-and-bound tree in the root node; here I think cutting planes are executed. Cplex for example can choose prim Simplex or dual Simplex etc. to solve the Problem in this case.
Is there a possibility in Scip too? I use the parameters lp/initalgorithm=b (barrier) and lp/resolvealgorithm=b to make sure, in the branch-and-bound tree only this algorithm is used. But when Scip solves the problem in the root node, these parameters change nothing.
Thanks for your help!
So if I understand you correctly you want to always use barrier to solve the LP relaxations of your problem?
You need to make sure that the LP solver you are using supports this. If you use SoPlex as the LP solver in SCIP it does not have a barrier algorithm implemented and will fallback to solving with dual Simplex instead.
The LP solvers that support barrier are Cplex, Xpress, Gurobi, Mosek, and CLP

Gurobi resume optimization after model modification

As far as i know Gurobi resumes optimizing where it left after calling Model.Terminate() and then calling Model.Optimize() again. So I can terminate and get the best solution so far and then proceed.Now I want to do the same, but since I want to use parts of the suboptimal solution I need to set some variables to fixed values before I call Model.Optimize() again and optimize the rest of the model. How can i do this so that gurobi does not start all over again?
First, it sounds like you're describing a mixed-integer program (MIP); model modification is different for continuous optimization (linear programming, quadratic programming).
When you modify a MIP model, the tree information is no longer helpful. Instead, you must resolve the continuous (LP) relaxation and create a new branch-and-cut tree. However, the prior solution may still be used as a MIP start, which can reduce the solve time for the second model.
However, your method may be redundant with the RINS algorithm, which is an automatic feature of Gurobi MIP. You can control the behavior of RINS via the parameters RINS, SubMIPNodes and Heuristics.

Column generation is exact or heuristic algorithm?

I know that column generation gives an optimal solution and it can be used with other heuristics. But does that make it an exact algorithm? Thanks in advance.
Traditional CG operates on the relaxed problem. Although it finds the optimal LP solution, this may not translate directly into an optimal MIP solution. For some problems (e.g. 1d cutting stock) there is evidence this gap is small, and we just apply the set of columns found for the relaxed problem to a final MIP knowing this is a good solution but necessarily optimal. So it is a heuristic.
With some effort you can use column generation inside a branch-and-bound algorithm (this is called branch-and-price). This gives proven optimal solutions.
An exact algorithm means that the algorithm can solve the optimization problem globally i.e it has given the global optima.
Column generation technique is conventionally applied to relaxed LP problem and tries to optimize the relaxed LP problem by constantly improving the current solution with the help of dual multipliers. It gives an exact LP solution for the relaxed LP problem. But sometimes in real-world problems, the exact solution of the relaxed Lp problem is not feasible to use, it needs to be translated to an integer solution in order to use it. Now if the problem scale is small, then there are many exact MIP algorithms (such as Branch and Bound) which can solve it exactly and give an integer solution. But if the problem is large-scale, even the exact MIP algorithms can take longer runtimes, hence, we use some special/intelligent heuristics to lower the difficulty of the MIP problem.
Summary: Column generation is an exact technique for solving the relaxed LP problem, not the original IP problem.
First, strictly speaking, all algorithms are heuristic, including Simplex Method.
Second, I think Column generation is a heuristic algorithm, because it solves the LP relaxation of the master problem. It does not guarantee IP optimal. Actually CG does not always converge very well.

Branch and Bound - what to store

I have read in more than one book (including Wolsey) that when implementing a branch and bound algorithm, one does not need to store the whole tree, just a list of active nodes (leaf nodes, for what I understand).
The thing is, I could not understand how to work out the new bounds after I branch, if I don't have the bounds of every ancestor.
Some clarification on that would be appreciated.
OK, let's work out an example. Let's say you're implementing a fairly naive integer program solver that tries to solve a binary integer program by solving its LP relaxation, and, if it doesn't get an integral solution, branches on some variable. Let's suppose you have a maximisation problem.
Let's consider what happens after exactly one branch. You solved the root subproblem, and suppose it gave you a fractional solution with objective value 10. Then you branched on a variable, giving you a left subproblem with optimal objective value 9 and a right subproblem with optimal objective value 8.
We got a global bound of 10 from the root subproblem. We also know that every integral solution lies in either the left subproblem or the right subproblem, and we know that the left subproblem has no solutions better than 9 and the right subproblem has no subproblems better than 8. Then there are no solutions better than 9 to the root subproblem, even though the root LP relaxation wasn't enough to tell us that.
In general, your best global bound is the worst bound any active subproblem. Fathomed subproblems are irrelevant since they can't contain a feasible solution with better objective value than your incumbent. Subproblems that have been branched are irrelevant because their bounds should be dominated by the weakest of their childrens' bounds.

Determining hopeless branches early in branch-and-bound algorithms

I have to design a branch-and bound algorithm that solves the optimal tour of a graph on the cartesian plane every time. I have been given the hint that identifying hopeless branches earlier in the runtime will compound into a program that runs "a hundred times faster". I had the idea of assuming that the shortest edge connected to the starting/ending node will be either the first or last edge in the tour but a thin diamond shaped graph proves otherwise. Does any one have ideas for how to eliminate these hopeless branches or a reference that talks about this?
Basically, is there a better way to branch to subsets of solutions better than just lexicographically, eg. first branch is including and excluding edge a-b, second branch includes and excludes branch a-c
So somewhere in your branch-and-bound algorithm, you look at possible places to go, and then somehow keep track of them to do later.
To make this more efficient, you can do a couple things:
Write a better bound calculator. In other words, come up with an algorithm that determines the bound more accurately. This will result in less time spent on paths that turn out to be poor.
Instead of using a stack to keep track of things to do, use a queue. Instead of using a queue, use a priority queue (heap) ordered by bound, e.g. the things that seem best are put at the top of the heap, and the things that seem bad are put on the bottom.
Nearest-neighbor is a simple algorithm. Branch-and-Bound is just an optimizing loop and additionally you need a sub-problem solver. I think nearest-neighbor is also a branch-and-bound algorithm. Instead I would look into the simplex algorithm. It's a linear programming algorithm. Also cutting-plane algorithm to solve tsp.