N-queens minimum and knights and bishops: Difference between revisions
N-queens minimum and knights and bishops (view source)
Revision as of 05:10, 28 April 2022
, 2 years agouse Cbc optimizer only
m (→{{header|J}}: fix broken state space pruning mechanism) |
m (use Cbc optimizer only) |
||
Line 458:
=={{header|Julia}}==
Uses the
<lang ruby>""" Rosetta code task N-queens_minimum_and_knights_and_bishops """
import Cbc
using JuMP
Line 482 ⟶ 481:
return 1, smatrix(a, N, char)
end
model = Model(
@variable(model, x[1:N, 1:N], Bin)
Line 512 ⟶ 511:
N == 2 && return 2, "$char .\n$char .\n"
model = Model(
@variable(model, x[1:N, 1:N], Bin)
Line 586 ⟶ 585:
81 5 9 14
100 5 10 16
Examples for N = 10:
|