Timeline for Minimising the Triangle version 2
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 10, 2020 at 13:24 | history | edited | CommunityBot |
Commonmark migration
|
|
Aug 14, 2015 at 4:44 | vote | accept | spyr03 | ||
Jun 25, 2015 at 23:46 | comment | added | spyr03 | Let us continue this discussion in chat. | |
Jun 25, 2015 at 23:42 | comment | added | maaartinus |
@spyr03 Sure, overwriting the array is a good and simple idea I've missed! I've just took it over in my code. +++ Extending a good base sounds good, however, I still haven't figured out how to do it efficiently. So far the best I could do is working from the top (0.4, 18, and 3100 seconds for size=8,9,10, respectively). +++ I guess that using facts like that all bases 1 2 a b c 3 x y z must fail could help a lot. But it's hard.
|
|
Jun 25, 2015 at 23:13 | comment | added | spyr03 | ie 1 2 4 7 becomes 3 6 11 7 => 9 17 11 7 => 26 7 11 7 | |
Jun 25, 2015 at 23:12 | comment | added | spyr03 | Actually I think I could go one better, and overwrite the same array, and this gives the added bonus that the side of the triangle is maintained, I can then use that to form bigger base sides with a smaller base by adding the base extending number, up from right to left, and while this triangle may not be valid, it can be used for pruning, see here: codereview.stackexchange.com/a/94302/58248 | |
Jun 25, 2015 at 19:57 | comment | added | maaartinus | @spyr03 "In regards to doubling the code in checkTriangle, it saved me a factor of 3 in runtime, would that not be worth it?" - Factor of 3 is good enough, but what was the alternative? I can't imaging that swapping the two arrays would be three times slower (but I can't exclude it either). | |
Jun 25, 2015 at 19:54 | comment | added | maaartinus |
@spyr03 "know the maximum base size is 13 for size = 7?" - I've found the optimum and looked at the row and there was nothing bigger. I wouldn't call it "trial and error", as I'm sure it was the optimum. But yes, before finding the optimum, I couldn't know. So you should not avoid bigger values, you just should try the smaller, i.e. the more promising first. This may be hard to achieve, starting with the base row, I can find the solution for size=8 in 6 seconds, but I get out of memory for size=9 .
|
|
Jun 25, 2015 at 19:23 | comment | added | spyr03 | Other than by trial and error, how do you know the maximum base size is 13 for size = 7? I tried using sum before, but it didn't really offer much compared to other areas, so I left it alone. The other suggestions are great, I will definitely try to pick better names and split methods up if they are doing too many things. In regards to doubling the code in checkTriangle, it saved me a factor of 3 in runtime, would that not be worth it? Code went from 2 minutes to about 40 seconds, and likewise for other base sizes | |
Jun 24, 2015 at 21:41 | history | edited | maaartinus | CC BY-SA 3.0 |
added 1453 characters in body
|
Jun 24, 2015 at 19:39 | history | answered | maaartinus | CC BY-SA 3.0 |