mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Puzzles

Reply
 
Thread Tools
Old 2018-08-25, 12:17   #45
WraithX
 
WraithX's Avatar
 
Mar 2006

479 Posts
Default

Quote:
Originally Posted by R. Gerbicz View Post
Stopped my search, updating all tables:
Some more excellent results! Like Till, I've come up with a better algorithm than what I started with, but it still can't compete with what you have going here.

Would you be willing to share your code and/or algorithm? I'd like to try to extend these tables to other sizes/bases.
WraithX is offline   Reply With Quote
Old 2018-08-25, 13:54   #46
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

148410 Posts
Default

Quote:
Originally Posted by WraithX View Post
Would you be willing to share your code and/or algorithm? I'd like to try to extend these tables to other sizes/bases.
OK, here it is, rename it to tiling.c, as it is a pure c code.
some remarks:
1. comment out line 461 if you don't want to see the thread report after each completed search (though in larger searches it is useful to see the progress)
2. it could be possible to improve the memory usage/speed for larger grids
3. before line 518 you could set up various conditions what you want/don't want to search, I've given you 3 examples there, the default is to search every m,n combinations.
4. use line 20,22,25,28 to set your problem/limitations.
Attached Files
File Type: txt tiling.txt (14.9 KB, 178 views)
R. Gerbicz is offline   Reply With Quote
Old 2018-08-25, 18:29   #47
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

148410 Posts
Default

Quote:
Originally Posted by R. Gerbicz View Post
some remarks:
adding:
base<=16 should be true! Not tried, it could start for base>16, but from the 2nd grid the results will be poor, because in the grid there will be at most only one digit>=16 due to the grid's storage.
R. Gerbicz is offline   Reply With Quote
Old 2018-08-30, 18:53   #48
Till
 
Till's Avatar
 
"Tilman Neumann"
Jan 2016
Germany

26·7 Posts
Default

Thanks a lot for sharing your code, Robert!


Due to your great numbers, I halfways expected that you found an existing algorithm that matches the problem and works better than a random search (augmented after reading the word "color" in your code). But indeed it is a highly speed- and memory-effective implementation of a random search. A great example of performant software engineering art, I'ld say.


For those interested to understand the implementation:
* b is the currently investigated rectangle
* on each iteration, one "good" b is chosen and undergone a "mutation" in a single location
* good b rectangles are stored in "mygrids" as a list of 64bit ints, each 64bit int holding 16 4-bit values (the program is designed for bases <= 16)
* the hash condition checks if a rectangle b has been tested before
* rectangles are shuffled up and down according to their number of misses of scores <= an expected new record score "rec+1"
Till is offline   Reply With Quote
Old 2018-09-01, 19:51   #49
Till
 
Till's Avatar
 
"Tilman Neumann"
Jan 2016
Germany

26·7 Posts
Default

Found a new 10x10 base 10 top score = 284:
Code:
1 1 6 9 1 9 1 8 1 9 
7 7 2 2 5 4 2 5 8 9 
0 2 4 2 3 1 6 1 0 1 
2 0 3 1 1 6 0 2 9 1 
6 5 2 8 1 4 1 3 6 0 
2 6 5 6 1 2 5 7 2 8 
3 7 2 1 7 9 1 1 5 2 
2 2 4 8 1 1 3 7 0 1 
8 4 7 0 4 3 8 2 7 9 
2 1 0 2 2 1 9 4 2 8
Till is offline   Reply With Quote
Old 2018-09-01, 23:57   #50
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by Till View Post
Found a new 10x10 base 10 top score = 284:
Code:
1 1 6 9 1 9 1 8 1 9 
7 7 2 2 5 4 2 5 8 9 
0 2 4 2 3 1 6 1 0 1 
2 0 3 1 1 6 0 2 9 1 
6 5 2 8 1 4 1 3 6 0 
2 6 5 6 1 2 5 7 2 8 
3 7 2 1 7 9 1 1 5 2 
2 2 4 8 1 1 3 7 0 1 
8 4 7 0 4 3 8 2 7 9 
2 1 0 2 2 1 9 4 2 8
corfirmed by eye.
science_man_88 is offline   Reply With Quote
Old 2018-09-02, 18:52   #51
Till
 
Till's Avatar
 
"Tilman Neumann"
Jan 2016
Germany

26·7 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
corfirmed by eye.

One look?
Till is offline   Reply With Quote
Old 2018-09-02, 18:59   #52
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

26·131 Posts
Default

Quote:
Originally Posted by Till View Post
One look?
no just remembered where I was ( 143 in one look I believe), then went back later.
science_man_88 is offline   Reply With Quote
Old 2018-09-03, 07:04   #53
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

22·7·53 Posts
Default

Quote:
Originally Posted by Till View Post
Found a new 10x10 base 10 top score = 284:
Code:
1 1 6 9 1 9 1 8 1 9 
7 7 2 2 5 4 2 5 8 9 
0 2 4 2 3 1 6 1 0 1 
2 0 3 1 1 6 0 2 9 1 
6 5 2 8 1 4 1 3 6 0 
2 6 5 6 1 2 5 7 2 8 
3 7 2 1 7 9 1 1 5 2 
2 2 4 8 1 1 3 7 0 1 
8 4 7 0 4 3 8 2 7 9 
2 1 0 2 2 1 9 4 2 8
Congrats! Probably there are still many easy fruits there, spent only roughly 1 day on base=10 (and also 1 day on base=2) using a core i7-6700 and the latest posted code (previous codes were [much] slower).
R. Gerbicz is offline   Reply With Quote
Old 2018-09-03, 13:15   #54
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

203008 Posts
Default

Quote:
Originally Posted by R. Gerbicz View Post
Congrats! Probably there are still many easy fruits there, spent only roughly 1 day on base=10 (and also 1 day on base=2) using a core i7-6700 and the latest posted code (previous codes were [much] slower).
if my counting is correct an absolute upper bound on 10 by 10 is 647 but that's likely unreachable. edit: okay plugging the math in PARI/GP gives 675 but that's still not 4 digits. 11 by 11 gives 819, 12 by 12 gives 979, and 13 by 13 breaks 1100 but again duplicates will.lower these.

Last fiddled with by science_man_88 on 2018-09-03 at 14:05
science_man_88 is offline   Reply With Quote
Old 2018-09-03, 15:22   #55
Till
 
Till's Avatar
 
"Tilman Neumann"
Jan 2016
Germany

1C016 Posts
Default

Quote:
Originally Posted by R. Gerbicz View Post
Congrats! Probably there are still many easy fruits there, spent only roughly 1 day on base=10 (and also 1 day on base=2) using a core i7-6700 and the latest posted code (previous codes were [much] slower).

Yes, it's quite easy to find better scores. Found several other small improvements but will post them all together.


On 10x10 base 10 I did a run over ~8 hours though because I was on a birthday party. My computer is a pretty old 7-2630QM.


I have a small improvement proposal: Instead of just collecting the number of misses, one could collect the scores actually missed and derive the next digit to place somewhere from that. So if your missing scores are 221, 222, 223 then you get a 7/9 chance that a "2" is placed, which will be a good choice. The collection can be stopped if the number of misses found is > your limit variable.
Till is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find the Squares a1call Puzzles 18 2018-03-02 16:47
Regarding Squares a1call Miscellaneous Math 42 2017-02-03 01:29
Counting Latin rectangles Dougy Math 3 2010-02-16 10:20
squares or not squares m_f_h Puzzles 45 2007-06-15 17:46
Prime squares/rectangles roger Puzzles 10 2007-05-04 16:07

All times are UTC. The time now is 03:37.


Sat Jul 17 03:37:46 UTC 2021 up 50 days, 1:25, 1 user, load averages: 1.27, 1.70, 1.64

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.