[ library(bfs) | Reference Manual | Alphabetic Index ]
# BfsInstance:solve(-Cost)

Optimise the problem associated with BfsInstance.
*Cost*
- The optimal solution cost of the problem associated with BfsInstance

## Description

A solver setup with solver_setup/2 or solver_setup/3 is triggered
using this predicate.

The node relaxation and separation solvers are applied to the next
selected node of the problem represented by Handle repeatedly until
no more open nodes remain. The criteria for node selection order
depends on the options given to solver_setup/2,3. solve/1 fails if
there is no solution or succeeds if an optimal solution is found,
returning the solution's cost in Cost. After a success, various
solution information and statistics can be retrieved using get/2,
var_get/3 and statistics/0.

### Fail Conditions

No solution exists satisfying the global feasibility conditions.
## See Also

solver_setup / 2, solver_setup / 3, get / 2, var_get / 3, statistics / 0