19 #include <boost/range/algorithm_ext/iota.hpp>
20 #include <boost/range/algorithm/random_shuffle.hpp>
22 void print(
const std::vector<int> &queens) {
23 for (
int q : queens) {
24 for (
int i = 0; i < q; ++i) {
28 for (
int i = 0; i < int(queens.size()) - q - 1; ++i) {
31 std::cout << std::endl;
39 std::vector<int> queens(9);
40 boost::iota(queens, 0);
41 boost::random_shuffle(queens);
44 std::cout <<
"start configuration" << std::endl;
52 std::cout <<
"final configuration" << std::endl;
void n_queens_solution_first_improving(NQueensPositionsVector &pos, components...nQueenscomponents)
n queen local search (simple version)
data_structures::components< data_structures::NameWithDefault< GetMoves, n_queensget_moves >, data_structures::NameWithDefault< Gain, n_queens_gain >, data_structures::NameWithDefault< Commit, n_queens_commit >>::type< Args...> n_queens_local_search_components
NQueen Compoenents.
bool local_search(Solution &solution, SearchStrategy searchStrategy, ContinueOnSuccess succ, ContinueOnFail fail, components...comps)
detail