tag:blogger.com,1999:blog-18900415.post4125281103406142870..comments2024-01-22T13:41:53.129-08:00Comments on collin park: Python and kakuroCollinhttp://www.blogger.com/profile/13754585516151204932noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-18900415.post-59223025492766746752010-03-16T21:27:27.382-07:002010-03-16T21:27:27.382-07:00Yep. I had an idea on the way home, but I was dri...Yep. I had an idea on the way home, but I was driving my car, so I didn't write any code. <br /><br />The idea I had was... maybe after going as far as you can go with the sorta naive approach of combinations, to switch to enumerating the permutations adding up to each sum. So rather than saying only that you need 7,8,9 to do 24 in three squares (wherein the first cell can't be 9 and the second cell can't be 8), I'd say that the values must be (7,9,8) or (8,7,9) or (8,9,7); this might save me some computation (I'm not quite sure if this obviates the "box" technique as mentioned in the wikipedia article on kakuro).<br /><br />But probably not tonight.Collinhttps://www.blogger.com/profile/13754585516151204932noreply@blogger.comtag:blogger.com,1999:blog-18900415.post-48401361247682234142010-03-16T21:18:15.988-07:002010-03-16T21:18:15.988-07:00Do you intend to work further on this?Do you intend to work further on this?Ozan Bellikhttps://www.blogger.com/profile/18336146981091160268noreply@blogger.comtag:blogger.com,1999:blog-18900415.post-88720779156736596122010-03-16T20:07:33.180-07:002010-03-16T20:07:33.180-07:00Uh, "...combination that doesn't contain ...Uh, "...combination that doesn't contain 1 is <b><i>im</i></b>possible"Collinhttps://www.blogger.com/profile/13754585516151204932noreply@blogger.comtag:blogger.com,1999:blog-18900415.post-6451463987294543652010-03-16T19:54:21.634-07:002010-03-16T19:54:21.634-07:00OK, about how I organized the search, it was very ...OK, about how I organized the search, it was very simple-minded. I have a list of possible values (initially 1-9) on all empty cells. Then given the totals (either across or down), I zap the set of possible values so it includes only those that appear in a combination. So for example if two cells must add up to 4, then at most the list of possibles will contain [1,3]. If going crosswise one of them is part of a two-cell combo that sums to 6, then that cell would be forced to 1. Once that cell is determined to be 1, no other cell in the same set can have that value. Similarly, any combination that doesn't contain 1 is possible. And so on.Collinhttps://www.blogger.com/profile/13754585516151204932noreply@blogger.comtag:blogger.com,1999:blog-18900415.post-79813981623534189332010-03-16T12:44:06.464-07:002010-03-16T12:44:06.464-07:00oh, whoopsoh, whoopsOzan Bellikhttps://www.blogger.com/profile/18336146981091160268noreply@blogger.comtag:blogger.com,1999:blog-18900415.post-55720168980947876272010-03-16T09:45:15.151-07:002010-03-16T09:45:15.151-07:00h9 is 8, so h6/h7/h8 sum to 18, not 26.
more late...h9 is 8, so h6/h7/h8 sum to 18, not 26.<br /><br />more laterCollinhttps://www.blogger.com/profile/13754585516151204932noreply@blogger.comtag:blogger.com,1999:blog-18900415.post-3721872241913472072010-03-15T21:56:45.631-07:002010-03-15T21:56:45.631-07:00How did you organize the search?
Also,
This puzz...How did you organize the search?<br /><br />Also,<br /><br />This puzzle doesn't seem to be solvable...<br /><br />D1 is restricted to 8 or 9 through D0.<br />The 9 branch dead ends with E2=E3=7, verifying D2=9,E1=2,E2=6,E3=7<br /><br />I1 is restricted to 8 or 9. The 9 branch dead ends with H2=G2=3, leaving I2=9,H1=3,H2=2,G2=3<br /><br />D3, E3, and G2 constrain F3 and G3 to 1 and 3, respectively.<br /><br />The four possibilities for F4 through F2 and F3 (6, 7, 8, 9) narrow down to 7, as that's the only value that yields a valid G4 in light of G2 and G3.<br /><br />F5=8, G5=9, H5=1 come through E5 and F and G columns.<br /><br />This leaves H6, H7, and H8 to add up to 26 (as per H4), an impossibility.<br /><br />Have I missed something?Ozan Bellikhttps://www.blogger.com/profile/18336146981091160268noreply@blogger.com