Commit 76f4001f authored by Richard Taupe's avatar Richard Taupe

suppl. material for ICLP 2019 paper

parent 98ac43c5

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

% INPUT:
% item_size(I,S): item no. I has size S
% bin(B): bin no. B
% bcap(C): all bins have capacity C
item(I) :- item_size(I,S).
% 1 { in(I,B) : bin(B) } 1 :- item(I).
{ in(I,B) } :- item(I), bin(B).
:- item(I), 2 <= #count { B : in(I,B), bin(B) }.
:- item(I), not has_bin(I).
has_bin(I) :- in(I,_).
% :- #sum { S,I : in(I,B), item_size(I,S) } > C, bcap(C), bin(B).
:- Cp1=C+1, Cp1 <= #sum { S,I : in(I,B), item_size(I,S) }, bcap(C), bin(B).
#heuristic in(I,B) : bin(B), item_size(I,S), bcap(C), C >= F + S, filled_at_least(B,F), not filled_at_least(B,F+1), not item_placed(I). [F+S@2,true]
#heuristic -in(I,B) : item(I), bin(B), not in(I,B). [1]
item_placed(I) :- in(I,_). % Attention: The equivalent predicate has_bin/1 must not be used in the heuristic condition since its atoms are already MBT due to the constraint and thus switch off the heuristic!
filled_at_least(B,F) :- bin(B), possible_fill_degree(F), F <= #sum { S,I : in(I,B), item_size(I,S) }.
possible_fill_degree(0..C) :- bcap(C).
\ No newline at end of file
% INPUT:
% item_size(I,S): item no. I has size S
% bin(B): bin no. B
% bcap(C): all bins have capacity C
item(I) :- item_size(I,S).
1 = { in(I,B) : bin(B) } :- item(I).
:- #sum { S,I : in(I,B), item_size(I,S) } > C, bcap(C), bin(B).
item_size(1,32).
item_size(2,57).
item_size(3,9).
item_size(4,70).
item_size(5,50).
item_size(6,17).
item_size(7,3).
item_size(8,76).
item_size(9,91).
item_size(10,88).
item_size(11,86).
item_size(12,49).
item_size(13,74).
item_size(14,77).
item_size(15,86).
item_size(16,10).
item_size(17,22).
item_size(18,69).
item_size(19,99).
item_size(20,58).
item_size(21,73).
item_size(22,14).
item_size(23,4).
item_size(24,29).
item_size(25,86).
item_size(26,42).
item_size(27,10).
item_size(28,9).
item_size(29,64).
item_size(30,75).
item_size(31,80).
item_size(32,70).
item_size(33,39).
item_size(34,93).
item_size(35,48).
item_size(36,58).
item_size(37,74).
item_size(38,83).
item_size(39,73).
item_size(40,25).
item_size(41,14).
item_size(42,13).
item_size(43,25).
item_size(44,50).
item_size(45,35).
item_size(46,82).
item_size(47,98).
item_size(48,80).
item_size(49,18).
item_size(50,57).
item_size(51,39).
item_size(52,18).
item_size(53,40).
item_size(54,31).
item_size(55,98).
item_size(56,51).
item_size(57,30).
item_size(58,92).
item_size(59,77).
item_size(60,59).
item_size(61,88).
item_size(62,93).
item_size(63,87).
item_size(64,69).
item_size(65,73).
item_size(66,95).
item_size(67,69).
item_size(68,44).
item_size(69,11).
item_size(70,27).
item_size(71,33).
item_size(72,81).
item_size(73,90).
item_size(74,21).
item_size(75,84).
item_size(76,20).
item_size(77,41).
item_size(78,34).
item_size(79,97).
item_size(80,1).
item_size(81,6).
item_size(82,71).
item_size(83,22).
item_size(84,40).
item_size(85,70).
item_size(86,73).
item_size(87,78).
item_size(88,46).
item_size(89,18).
item_size(90,59).
item_size(91,32).
item_size(92,79).
item_size(93,51).
item_size(94,49).
item_size(95,72).
item_size(96,88).
item_size(97,63).
item_size(98,92).
item_size(99,88).
item_size(100,60).
bcap(100).
bin(1..83).
\ No newline at end of file
item_size(1,64).
item_size(2,44).
item_size(3,19).
item_size(4,98).
item_size(5,32).
item_size(6,9).
item_size(7,71).
item_size(8,40).
item_size(9,43).
item_size(10,86).
item_size(11,49).
item_size(12,60).
item_size(13,98).
item_size(14,2).
item_size(15,35).
item_size(16,64).
item_size(17,82).
item_size(18,83).
item_size(19,9).
item_size(20,50).
item_size(21,17).
item_size(22,46).
item_size(23,74).
item_size(24,59).
item_size(25,17).