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).