SCIPvariablegraphBreadthFirst

Function SCIPvariablegraphBreadthFirst 

Source
pub unsafe extern "C" fn SCIPvariablegraphBreadthFirst(
    scip: *mut SCIP,
    vargraph: *mut SCIP_VGRAPH,
    startvars: *mut *mut SCIP_VAR,
    nstartvars: c_int,
    distances: *mut c_int,
    maxdistance: c_int,
    maxvars: c_int,
    maxbinintvars: c_int,
) -> SCIP_RETCODE
Expand description

Perform breadth-first (BFS) search on the variable constraint graph.

The result of the algorithm is that the \p distances array contains the correct distances for every variable from the start variables. The distance of a variable can then be accessed through its problem index (calling SCIPvarGetProbindex()). Hence, The method assumes that the length of \p distances is at least SCIPgetNVars(). Variables that are not connected through constraints to the start variables have a distance of -1.

Limits can be provided to further restrict the breadth-first search. If a distance limit is given, the search will be performed until the first variable at this distance is popped from the queue, i.e., all variables with a distance < maxdistance have been labeled by the search. If a variable limit is given, the search stops after it completes the distance level at which the limit was reached. Hence, more variables may be actually labeled. The start variables are accounted for those variable limits.

If no variable variable constraint graph is provided, the method will create one and free it at the end This is useful for a single use of the variable constraint graph. For several consecutive uses, it is advised to create a variable constraint graph via SCIPvariableGraphCreate().