user_find_cuts

int user_find_cuts(void *user, int varnum, int iter_num, int level,
		    int index, double objval, int *indices, double *values,
		    double ub, double lpetol, int *cutnum)

Description:

In this function, the user can generate cuts based on the current LP solution stored in soln. Cuts found are added to the LP by calling the cg_add_user_cut(cut_data *new_cut) function, which then transfers the cut to the LP module, either through message passing or shared memory. The argument of this function is a pointer to the cut to be sent. See Section 6.3.2 for a description of this data structure. Each user-defined cut assigned a type and a designated packed form. Each user-defined type must be recognized by the user's user_unpack_cuts() function in the master module. If the user wants a user-defined cut to be added to the cut pool in case it proves to be effective in the LP, then new_cut->name should be set to CUT__SEND_TO_CP. In this case, the cut must be globally valid. Otherwise, it should be set to CUT__DO_NOT_SEND_TO_CP.

Alternatively, SYMPHONY provides automated support for the generation of cuts represented explicitly as matrix rows. These cuts are passed as sparse vectors and can be added by calling the routine cg_add_explicit_cut(), which has the following interface.

int cg_add_explicit_cut(int nzcnt, int *indices, double *values,
                        double rhs, double range, char sense, 
                        char send_to_cp)
Here, nzcnt is the number of nonzero coefficients in the cut, indices is an array containing the indices of the columns with nonzero entries, and values is an array of the corresponding values. The right hand side value is passed in through the variable rhs, the range is passed in through the variable range, and the sense of the inequality is passed through the variable sense. Finally, the variable send_to_cp indicates to SYMPHONY whether the cut is globally valid and should be sent to the cut pool, or whether it is only to be used locally.

The only output of the user_find_cuts() function is the number of cuts generated and this value is returned in the last argument. For options to generate generic cuts automatically using the COIN Cut Generation Library, see the function user_generate_cuts_in_lp()

Arguments:

void *user IN Pointer to the user-defined data structure.
int iter_num IN The iteration number of the current LP solution.
int level IN The level in the tree on which the current LP solution was generated.
index IN The index of the node in which LP solution was generated.
objval IN The objective function value of the current LP solution.
int varnum IN The number of nonzeros in the current LP solution.
indices IN The column indices of the nonzero variables in the current LP solution.
values IN The values of the nonzero variables listed in indices.
double ub IN The current global upper bound.
double lpetol IN The current error tolerance in the LP.
int *cutnum OUT Pointer to the number of cuts generated and sent to the LP.

Return values:

USER_ERROR Ignored.
USER_SUCCESS The user function exited properly.
USER_DEFAULT No cuts were generated.

Invoked from:
Whenever an LP solution is received.