N-queens minimum and knights and bishops: Difference between revisions

m
use Cbc optimizer only
m (→‎{{header|J}}: fix broken state space pruning mechanism)
m (use Cbc optimizer only)
Line 458:
 
=={{header|Julia}}==
Uses the HiGHCbc optimizer for Queens and Bishops and the slower (github.com/coin-or/Cbc optimizer) for Knights for Cbc'sits complementarity support.
<lang ruby>""" Rosetta code task N-queens_minimum_and_knights_and_bishops """
 
import HiGHS
import Cbc
using JuMP
Line 482 ⟶ 481:
return 1, smatrix(a, N, char)
end
model = Model(HiGHSCbc.Optimizer)
@variable(model, x[1:N, 1:N], Bin)
 
Line 512 ⟶ 511:
N == 2 && return 2, "$char .\n$char .\n"
 
model = Model(HiGHSCbc.Optimizer)
@variable(model, x[1:N, 1:N], Bin)
 
Line 586 ⟶ 585:
81 5 9 14
100 5 10 16
6449.108607922920 seconds (3530.5387 M allocations: 1.898656 GiB, 2.2639% gc time, 7165.0549% compilation time)
 
Examples for N = 10:
4,102

edits