subroutine minlp_solver(n,x,l,u,m,lambda,equatn,linear,rho,constf,&
     epsfeas,epsopk,maxit,iter,f,g,gpsupn,cnorm,cnormu,geninfo,inform,&
     numBinary,numInteger,variableTypes,minlpinfo)

  use MINLP
  use LinkedList
  use OptionsReader

  implicit none

  ! SCALAR ARGUMENTS
  logical, intent(in)     :: constf
  integer, intent(in)     :: m,maxit,n,numBinary,numInteger
  integer, intent(out)    :: geninfo,iter,minlpinfo
  integer, intent(in out) :: inform
  double precision, intent(out)    :: f,gpsupn
  double precision, intent(in)     :: epsfeas,epsopk
  double precision, intent(in out) :: cnorm,cnormu

  ! ARRAY ARGUMENTS
  logical, intent(in) :: equatn(m),linear(m)
  integer, intent(in) :: variableTypes(n)
  double precision, intent(in)     :: lambda(m),rho(m)
  double precision, intent(out)    :: g(n)
  double precision, intent(in out) :: x(n),l(n),u(n)

  ! LOCAL SCALARS
  logical :: solutionFound
  integer :: branchingVariableStrategy,multistartStrategy,nodeSelection
  integer :: iterations,maxSolverCalls,iterationSolutionFound
  integer :: numNodesGenerated,numProblemsSolved
  real    :: timeAlg
  logical, save :: isOptionsRead = .false.

  ! OTHER LOCAL VARIABLES
  type(bb_options), save :: options

  if(.not. isOptionsRead) then
     call readOptions(options)
     isOptionsRead = .true.
  end if

  timeAlg = -1.0

  ! Node selection strategy.
  nodeSelection = getNodeSelectionStrategy(options)

  ! Variable selection strategy.
  branchingVariableStrategy = getBranchingVariableStrategy(options)

  maxSolverCalls = getNumNodeResolutions(options)

  multistartStrategy = getMultiStartStrategy(options)

  call BranchAndBound(n,x,l,u,m,lambda,equatn,linear,rho,constf,epsfeas,&
       epsopk,maxit,iter,f,g,gpsupn,cnorm,cnormu,geninfo,inform,numBinary,&
       numInteger,iterations,solutionFound,nodeSelection,&
       branchingVariableStrategy,multistartStrategy,maxSolverCalls,&
       numNodesGenerated,numProblemsSolved,iterationSolutionFound,&
       variableTypes,minlpinfo,options)

  call printSolution(f,x,n,iterations,timeAlg,solutionFound,&
       numNodesGenerated,numProblemsSolved)

end subroutine minlp_solver
