home | features | introductory examples | more examples | getting started | easy FAQ | advanced FAQ | download | help | about

advanced FAQ



How well does it scale ?

Using the following model on an Intel i7 2.4 GHz, EasyCP can solve the 1000-queens problem in 1 second. This is more or less what you can expect from most state-of-the-art solvers.

{
    const int N = 1000;
    typedef List<SInt<0, oo> > Queens;

    Queens queens(N);
    List<Int> queens1(N);
    List<Int> queens2(N);

    for (int i = 0 ; i < N ; ++i)
        queens[i] < N;

    for(int i = 0 ; i < N ; ++i)
    {
      queens1[i] == queens[i] + i;
      queens2[i] == queens[i] - i;
    }

    all_diff(queens);
    all_diff(queens1);
    all_diff(queens2);

    SolSet<Queens> S(queens);
    S.Search().use(queens, choice::variable::smallest_domain, valueChoice);
    cout << to_string(*S.begin());
}

Notice, however, that EasyCP's first focus is not efficiency. Rather, emphasis is put on ease of use and rapid prototyping.

home | features | introductory examples | more examples | getting started | easy FAQ | advanced FAQ | download | help | about