From d67659cbcb9d0d4df843536c327601e20af0acad Mon Sep 17 00:00:00 2001 From: KazushiKawamura Date: Sat, 10 Aug 2019 00:55:39 +0900 Subject: [PATCH] improve algorithm --- solver_soft/answer/A040.txt | 21 ++++++++++++++++ solver_soft/answer/A173.txt | 41 ++++++++++++++++++++++++++++++++ solver_soft/answer/A184.txt | 21 ++++++++++++++++ solver_soft/answer/A338.txt | 21 ++++++++++++++++ solver_soft/answer/A368.txt | 19 +++++++++++++++ solver_soft/answer/A371.txt | 20 ++++++++++++++++ solver_soft/answer/A379.txt | 33 +++++++++++++++++++++++++ solver_soft/answer/A392.txt | 20 ++++++++++++++++ solver_soft/answer/A429.txt | 41 ++++++++++++++++++++++++++++++++ solver_soft/answer/A470.txt | 39 ++++++++++++++++++++++++++++++ solver_soft/answer/A498.txt | 36 ++++++++++++++++++++++++++++ solver_soft/answer/A502.txt | 37 ++++++++++++++++++++++++++++ solver_soft/{ => answer}/out.txt | 0 solver_soft/main.cpp | 2 +- solver_soft/param.hpp | 6 ++--- solver_soft/solver.cpp | 8 +++++-- solver_soft/tools.cpp | 6 ++--- 17 files changed, 362 insertions(+), 9 deletions(-) create mode 100644 solver_soft/answer/A040.txt create mode 100644 solver_soft/answer/A173.txt create mode 100644 solver_soft/answer/A184.txt create mode 100644 solver_soft/answer/A338.txt create mode 100644 solver_soft/answer/A368.txt create mode 100644 solver_soft/answer/A371.txt create mode 100644 solver_soft/answer/A379.txt create mode 100644 solver_soft/answer/A392.txt create mode 100644 solver_soft/answer/A429.txt create mode 100644 solver_soft/answer/A470.txt create mode 100644 solver_soft/answer/A498.txt create mode 100644 solver_soft/answer/A502.txt rename solver_soft/{ => answer}/out.txt (100%) diff --git a/solver_soft/answer/A040.txt b/solver_soft/answer/A040.txt new file mode 100644 index 0000000..b8ff7fe --- /dev/null +++ b/solver_soft/answer/A040.txt @@ -0,0 +1,21 @@ +SIZE 10X10 +0, 0, 0, 0, 0, 0, 2, 2, 2, 0 +0, 0, 0, 0, 3,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 0, 0, 0, 0, 0, 0 +0, 0, 5, 2, 0, 0, 0, 0, 0, 0, 0 +0, 5, 5, 2, 0, 0, 0, 0, 0, 0, 0 +0, 5, 2, 2, 0, 0, 0, 0, 0, 0, 0 +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +BLOCK#1 @(6,4) +BLOCK#2 @(8,0) +BLOCK#3 @(5,8) +BLOCK#4 @(0,4) +BLOCK#5 @(0,15) +BLOCK#6 @(6,1) +BLOCK#7 @(0,0) +BLOCK#8 @(3,10) +BLOCK#9 @(2,0) +BLOCK#10 @(0,8) +BLOCK#11 @(4,0) +BLOCK#12 @(5,7) +BLOCK#13 @(3,6) +BLOCK#14 @(0,18) +BLOCK#15 @(0,3) +BLOCK#16 @(3,9) +BLOCK#17 @(0,12) +BLOCK#18 @(9,0) +BLOCK#19 @(5,5) +BLOCK#20 @(4,2) diff --git a/solver_soft/answer/A184.txt b/solver_soft/answer/A184.txt new file mode 100644 index 0000000..afcbd93 --- /dev/null +++ b/solver_soft/answer/A184.txt @@ -0,0 +1,21 @@ +SIZE 8X10 +0, 6, 0, 0, 0, 0, 0, 0 +0, 6, 0, 0, 0, 0, 2, 0 +0, 6, 0, 0, 3, 3, 2, 2 +0, 0, 0, 8, 5, 3, 3, 2 +0, 8, 8, 8, 5, 0, 3, 2 +1, 8, 0, 0, 5, 4, 0, 0 +1, 0, 0, 0, 5, 4, 0, 0 +1, 7, 7, 0, 0, 0, 0, 0 +1, 0, 0, 0, 0, 0, 0, 0 +1, 0, 0, 0, 0, 0, 0, 0 +BLOCK#1 @(0,5) +BLOCK#2 @(3,2) +BLOCK#3 @(2,6) +BLOCK#4 @(0,7) +BLOCK#5 @(4,6) +BLOCK#6 @(5,0) +BLOCK#7 @(0,0) +BLOCK#8 @(3,0) +BLOCK#9 @(5,4) +BLOCK#10 @(0,2) diff --git a/solver_soft/answer/A338.txt b/solver_soft/answer/A338.txt new file mode 100644 index 0000000..30c96cd --- /dev/null +++ b/solver_soft/answer/A338.txt @@ -0,0 +1,21 @@ +SIZE 10X10 +0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +7, 0, 0, 0, 8, 8, 0, 3, 1, 1 +7, 7, 0, 0, 0, 0, 0, 3, 0, 1 +0, 7, 4, 0, 3, 3, 3, 3, 0, 1 +0, 0, 4, 0, 1, 1, 1, 1, 1, 1 +0, 0, 4, 4, 0, 0, 0, 0, 0, 0 +0, 0, 0, 5, 0, 2, 2, 0, 0, 0 +6, 6, 0, 5, 0, 0, 2, 0, 0, 0 +6, 5, 5, 5, 0, 0, 2, 0, 0, 0 +6, 0, 2, 2, 2, 2, 2, 0, 0, 0 +BLOCK#1 @(5,0) +BLOCK#2 @(3,0) +BLOCK#3 @(2,3) +BLOCK#4 @(4,5) +BLOCK#5 @(0,8) +BLOCK#6 @(7,0) +BLOCK#7 @(0,3) +BLOCK#8 @(0,5) +BLOCK#9 @(2,4) +BLOCK#10 @(0,1) diff --git a/solver_soft/answer/A368.txt b/solver_soft/answer/A368.txt new file mode 100644 index 0000000..2b6edd2 --- /dev/null +++ b/solver_soft/answer/A368.txt @@ -0,0 +1,19 @@ +SIZE 9X8 +0, 0, 0, 6, 6, 6, 6, 0, 0 +7, 0, 0, 3, 0, 0, 6, 8, 8 +7, 7, 0, 3, 3, 6, 6, 0, 8 +0, 0, 0, 0, 1, 1, 0, 0, 8 +0, 0, 2, 2, 0, 1, 0, 0, 8 +5, 5, 0, 0, 0, 0, 0, 0, 8 +4, 5, 0, 0, 8, 8, 8, 8, 8 +4, 0, 0, 0, 0, 0, 0, 0, 0 +BLOCK#1 @(7,0) +BLOCK#2 @(0,6) +BLOCK#3 @(0,7) +BLOCK#4 @(0,2) +BLOCK#5 @(4,4) +BLOCK#6 @(0,4) +BLOCK#7 @(0,0) +BLOCK#8 @(2,0) +BLOCK#9 @(3,4) +BLOCK#10 @(4,1) diff --git a/solver_soft/answer/A371.txt b/solver_soft/answer/A371.txt new file mode 100644 index 0000000..9ac9edb --- /dev/null +++ b/solver_soft/answer/A371.txt @@ -0,0 +1,20 @@ +SIZE 8X9 +0, 6, 6, 0, 0, 0, 0, 0 +0, 0, 1, 0, 0, 0, 0, 0 +0, 0, 1, 0, 0, 7, 0, 0 +8, 3, 3, 3, 0, 7, 7, 5 +8, 0, 0, 3, 0, 0, 0, 5 +8, 0, 0, 0, 2, 0, 5, 5 +8, 0, 0, 0, 2, 0, 0, 0 +8, 0, 0, 4, 0, 0, 0, 0 +0, 0, 4, 4, 0, 0, 0, 0 +BLOCK#1 @(0,2) +BLOCK#2 @(2,0) +BLOCK#3 @(1,4) +BLOCK#4 @(4,4) +BLOCK#5 @(5,2) +BLOCK#6 @(5,0) +BLOCK#7 @(0,7) +BLOCK#8 @(2,6) +BLOCK#9 @(0,0) +BLOCK#10 @(2,1) diff --git a/solver_soft/answer/A379.txt b/solver_soft/answer/A379.txt new file mode 100644 index 0000000..26c30ea --- /dev/null +++ b/solver_soft/answer/A379.txt @@ -0,0 +1,33 @@ +SIZE 18X12 +0, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 8, 8, 0, 0, 0, 0 +0, 3, 3, 0, 2, 2, 2, 2, 2, 2, 2, 0, 0, 8, 0, 0, 9, 0 +0, 0, 0, 10, 10, 0, 0, 8, 8, 8, 0, 0, 0, 8, 0, 0, 9, 0 +0, 0, 0, 0, 10, 10, 0, 8, 0, 8, 8, 0, 0, 8, 0, 0, 9, 0 +0, 0, 0, 0, 0, 8, 8, 8, 0, 0, 8, 8, 8, 8, 0, 0, 9, 0 +0, 0, 0, 0, 7, 7, 7, 0, 0, 9, 9, 9, 9, 9, 9, 9, 9, 0 +0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +0, 0, 6, 0, 1, 1, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +0, 5, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +BLOCK#1 @(5,3) +BLOCK#2 @(3,6) +BLOCK#3 @(2,1) +BLOCK#4 @(16,0) +BLOCK#5 @(11,3) +BLOCK#6 @(2,3) +BLOCK#7 @(0,10) +BLOCK#8 @(8,4) +BLOCK#9 @(14,0) +BLOCK#10 @(0,0) +BLOCK#11 @(1,5) +BLOCK#12 @(5,7) +BLOCK#13 @(0,4) +BLOCK#14 @(7,0) +BLOCK#15 @(1,1) +BLOCK#16 @(0,8) +BLOCK#17 @(12,0) +BLOCK#18 @(4,8) +BLOCK#19 @(5,0) +BLOCK#20 @(10,1) diff --git a/solver_soft/answer/A392.txt b/solver_soft/answer/A392.txt new file mode 100644 index 0000000..edd6232 --- /dev/null +++ b/solver_soft/answer/A392.txt @@ -0,0 +1,20 @@ +SIZE 9X9 +0, 0, 0, 2, 2, 0, 0, 0, 0 +0, 1, 0, 2, 0, 0, 3, 5, 0 +0, 1, 0, 2, 3, 3, 3, 5, 5 +0, 1, 1, 0, 0, 8, 8, 8, 5 +4, 4, 4, 4, 4, 4, 0, 8, 5 +0, 0, 0, 0, 0, 0, 8, 8, 5 +0, 0, 7, 7, 6, 0, 6, 5, 5 +7, 7, 0, 7, 6, 0, 6, 0, 0 +0, 7, 7, 7, 6, 6, 6, 0, 0 +BLOCK#1 @(0,3) +BLOCK#2 @(0,6) +BLOCK#3 @(0,0) +BLOCK#4 @(2,2) +BLOCK#5 @(4,5) +BLOCK#6 @(4,3) +BLOCK#7 @(4,0) +BLOCK#8 @(6,0) +BLOCK#9 @(2,5) +BLOCK#10 @(5,5) diff --git a/solver_soft/answer/A429.txt b/solver_soft/answer/A429.txt new file mode 100644 index 0000000..f18412b --- /dev/null +++ b/solver_soft/answer/A429.txt @@ -0,0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+BLOCK#12 @(3,3) +BLOCK#13 @(5,0) +BLOCK#14 @(1,11) +BLOCK#15 @(0,14) +BLOCK#16 @(0,3) +BLOCK#17 @(5,5) +BLOCK#18 @(6,1) +BLOCK#19 @(2,9) +BLOCK#20 @(0,7) diff --git a/solver_soft/answer/A470.txt b/solver_soft/answer/A470.txt new file mode 100644 index 0000000..1b770c9 --- /dev/null +++ b/solver_soft/answer/A470.txt @@ -0,0 +1,39 @@ +SIZE 15X18 +0, 10, 10, 10, 0, 5, 5, 5, 5, 0, 0, 0, 11, 11, 0 +0, 10, 0, 10, 0, 5, 0, 0, 5, 0, 0, 0, 0, 0, 15 +4, 0, 0, 0, 0, 12, 12, 0, 7, 0, 0, 0, 0, 0, 15 +4, 0, 0, 0, 6, 6, 12, 7, 7, 0, 0, 0, 0, 0, 15 +4, 0, 0, 6, 6, 0, 0, 14, 0, 0, 0, 0, 0, 0, 15 +3, 3, 0, 9, 2, 0, 0, 14, 14, 14, 0, 0, 0, 0, 15 +0, 3, 0, 9, 2, 0, 0, 0, 0, 14, 0, 0, 0, 0, 15 +8, 8, 0, 9, 2, 9, 13, 13, 1, 14, 0, 0, 0, 0, 15 +0, 8, 0, 9, 9, 9, 0, 14, 1, 14, 14, 0, 0, 0, 15 +0, 8, 15, 0, 0, 0, 0, 14, 0, 0, 14, 15, 15, 15, 15 +0, 8, 15, 15, 15, 0, 0, 14, 0, 0, 14, 15, 0, 0, 0 +0, 8, 0, 0, 15, 0, 0, 14, 14, 14, 14, 15, 0, 0, 0 +0, 8, 8, 0, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 0 +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +BLOCK#1 @(0,13) +BLOCK#2 @(4,6) +BLOCK#3 @(2,8) +BLOCK#4 @(5,3) +BLOCK#5 @(4,1) +BLOCK#6 @(2,3) +BLOCK#7 @(9,0) +BLOCK#8 @(7,1) +BLOCK#9 @(6,8) +BLOCK#10 @(0,8) +BLOCK#11 @(7,6) +BLOCK#12 @(0,4) +BLOCK#13 @(13,0) +BLOCK#14 @(4,4) +BLOCK#15 @(2,11) +BLOCK#16 @(11,0) +BLOCK#17 @(3,0) +BLOCK#18 @(0,1) +BLOCK#19 @(0,6) +BLOCK#20 @(0,16) diff --git a/solver_soft/answer/A498.txt b/solver_soft/answer/A498.txt new file mode 100644 index 0000000..7ecafc2 --- /dev/null +++ b/solver_soft/answer/A498.txt @@ -0,0 +1,36 @@ +SIZE 16X15 +3, 3, 3, 3, 3, 3, 8, 8, 8, 8, 9, 9, 0, 0, 0, 0 +3, 12, 12, 0, 4, 4, 8, 0, 0, 0, 9, 0, 0, 0, 0, 0 +2, 0, 12, 0, 4, 11, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0 +2, 12, 12, 0, 0, 11, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0 +2, 12, 0, 11, 11, 11, 0, 0, 0, 0, 7, 7, 7, 7, 7, 0 +2, 0, 0, 0, 7, 7, 7, 7, 7, 7, 7, 14, 14, 14, 7, 0 +2, 7, 7, 7, 7, 0, 0, 0, 14, 14, 14, 14, 0, 14, 7, 0 +2, 7, 6, 6, 6, 0, 13, 13, 0, 0, 0, 15, 15, 14, 7, 0 +2, 1, 1, 1, 0, 14, 14, 13, 15, 15, 15, 15, 0, 14, 7, 0 +0, 0, 0, 1, 0, 0, 14, 14, 14, 14, 14, 14, 0, 14, 7, 0 +0, 7, 0, 1, 0, 0, 0, 0, 0, 0, 0, 14, 14, 14, 7, 0 +0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0 +0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +5, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +BLOCK#1 @(13,0) +BLOCK#2 @(12,6) +BLOCK#3 @(6,3) +BLOCK#4 @(0,1) +BLOCK#5 @(2,12) +BLOCK#6 @(7,1) +BLOCK#7 @(1,4) +BLOCK#8 @(10,2) +BLOCK#9 @(3,1) +BLOCK#10 @(7,6) +BLOCK#11 @(4,7) +BLOCK#12 @(0,9) +BLOCK#13 @(9,3) +BLOCK#14 @(0,12) +BLOCK#15 @(2,9) +BLOCK#16 @(0,7) +BLOCK#17 @(5,6) +BLOCK#18 @(5,0) +BLOCK#19 @(11,0) +BLOCK#20 @(9,0) diff --git a/solver_soft/answer/A502.txt b/solver_soft/answer/A502.txt new file mode 100644 index 0000000..d36aa23 --- /dev/null +++ b/solver_soft/answer/A502.txt @@ -0,0 +1,37 @@ +SIZE 12X16 +0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 +0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 8 +4, 4, 4, 1, 0, 0, 0, 0, 0, 0, 0, 8 +4, 0, 0, 7, 7, 0, 8, 8, 8, 8, 8, 8 +4, 5, 5, 5, 7, 0, 8, 0, 0, 0, 0, 0 +4, 5, 0, 0, 0, 0, 0, 3, 3, 3, 0, 0 +4, 5, 5, 0, 0, 0, 9, 9, 0, 3, 0, 0 +4, 4, 10, 10, 10, 0, 9, 3, 3, 3, 0, 0 +0, 0, 0, 0, 0, 0, 9, 9, 0, 0, 0, 0 +0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0 +0, 0, 0, 0, 0, 0, 2, 0, 6, 0, 0, 0 +0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0 +0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0 +0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0 +0, 6, 0, 6, 6, 6, 6, 6, 6, 0, 0, 0 +0, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0 +BLOCK#1 @(0,8) +BLOCK#2 @(0,13) +BLOCK#3 @(4,5) +BLOCK#4 @(2,4) +BLOCK#5 @(0,9) +BLOCK#6 @(8,0) +BLOCK#7 @(6,9) +BLOCK#8 @(4,0) +BLOCK#9 @(7,8) +BLOCK#10 @(6,0) +BLOCK#11 @(3,9) +BLOCK#12 @(0,10) +BLOCK#13 @(7,5) +BLOCK#14 @(1,6) +BLOCK#15 @(0,0) +BLOCK#16 @(10,0) +BLOCK#17 @(5,3) +BLOCK#18 @(1,2) +BLOCK#19 @(0,11) +BLOCK#20 @(0,1) diff --git a/solver_soft/out.txt b/solver_soft/answer/out.txt similarity index 100% rename from solver_soft/out.txt rename to solver_soft/answer/out.txt diff --git a/solver_soft/main.cpp b/solver_soft/main.cpp index 253ac88..0ce9186 100644 --- a/solver_soft/main.cpp +++ b/solver_soft/main.cpp @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) { show_result(line_num, blocks, W_ext, H_ext, opt_result, block_place_basis); } if(W_ext > W || H_ext > H) { - cout << "Fail satisfying constraint" << endl; + cout << "Fail satisfying constraint T_T" << endl; } else { cout << "Satisfy constraint ^_^" << endl; diff --git a/solver_soft/param.hpp b/solver_soft/param.hpp index 2cf51a5..34b29d3 100644 --- a/solver_soft/param.hpp +++ b/solver_soft/param.hpp @@ -29,7 +29,7 @@ #define RI 3 #define BO 4 -#define SA_O 100 +#define SA_O 1000 #define SA_I 100000 #define TEMP_S 500 #define TEMP_E 0.1 @@ -37,8 +37,8 @@ #define INTER_BLOCK_MARGIN 2 #define LOOP 50 -#define TRY_LIMIT 50 -#define NO_MOVE 4 +#define TRY_LIMIT 500 +#define NO_MOVE 10 #define LFSR_RAND_MAX 4294967295 diff --git a/solver_soft/solver.cpp b/solver_soft/solver.cpp index 61dede2..9eb718a 100755 --- a/solver_soft/solver.cpp +++ b/solver_soft/solver.cpp @@ -480,7 +480,7 @@ bool local_placement_with_routing_2(short int line_num, short int blocks, short } } if(move_x) { - block_place_slack[t][0]++; + if(++block_place_slack[t][0] >= 9) break; } else { break; @@ -503,7 +503,7 @@ bool local_placement_with_routing_2(short int line_num, short int blocks, short } } if(move_y) { - block_place_slack[t][1]++; + if(++block_place_slack[t][1] >= 9) break; } else { break; @@ -531,6 +531,10 @@ bool local_placement_with_routing_2(short int line_num, short int blocks, short case 0: dx = lfsr_x_random() % (block_place_slack[i][0] + 1); break; case 1: dy = lfsr_y_random() % (block_place_slack[i][1] + 1); break; } + if(lfsr_random() % 16 >= 2) { + dx = 0; + dy = 0; + } block_place_delta[i] = make_pair(dx, dy); d_sum += dx + dy; for(int it = 1; it < 5; it++) { diff --git a/solver_soft/tools.cpp b/solver_soft/tools.cpp index d84e3fb..a2788bb 100644 --- a/solver_soft/tools.cpp +++ b/solver_soft/tools.cpp @@ -44,7 +44,7 @@ void show_result(short int line_num, short int blocks, short int wi, short int h } cout << setfill(' '); cout << dec; - for(int i = 1; i <= blocks; i++) { - cout << "BLOCK#" << i << " @(" << block_place[i].first << "," << block_place[i].second << ")" << endl; - } + //for(int i = 1; i <= blocks; i++) { + // cout << "BLOCK#" << i << " @(" << block_place[i].first << "," << block_place[i].second << ")" << endl; + //} } -- 2.22.0