SolverFactory solverFactory = SolverFactory.createFromXmlResource(
"org/optaplanner/examples/nqueens/solver/nqueensSolverConfig.xml");
Solver solver = solverFactory.buildSolver();
// Load a problem with 8 queens
NQueens unsolved8Queens = new NQueensGenerator().createNQueens(8);
// Solve the problem
solver.solve(unsolved8Queens);
NQueens solved8Queens = (NQueens) solver.getBestSolution();