あなたは7×7(sudoku-ish)中心の合計パズルを解くことができますか

私は競技会やラリーでこのパズルを数回見てきましたが、プログラム的にも数値的にも解決策を見つけられないため、困っています。そして、私はもはやオンラインの跡、それの名前、解決策/解決策を見つけることさえできません。

これは基本的に7×7のグリッドで、9つの中心が周囲のセルに集計されます。

# # # # # # #  
# A # B # C#  
# # # # # # #  
# D # E # F #  
# # # # # # #  
# G # H # I #  
# # # # # # #

与えられた数字はA、B、C、D、E、F、G、H、Iであり、任意の(完全な)行または列(つまり、A〜Iと交差しない行と列)

任意の与えられた数の集合に対して1つ以上の解が存在する可能性がありますが、これを100%確認することはできませんが、

私はExcelとmatlabでこれを解決しようとしましたが、matlabコードは、すでに1から7までの行と列を入れ替えて7×7行列のすべての集合を繰り返し処理します。この解決法は、可能なソリューションの多くのセットをスキップします。

1から7の行と列を塗りつぶすことによって見つけられる簡単な解決法は次のとおりです。

1 2 3 4 5 6 7
2 A 4 B 6 C 1
3 4 5 6 7 1 2
4 D 6 E 1 F 3
5 6 7 1 2 3 4
6 G 1 H 3 I 5
7 1 2 3 4 5 6

この場合、私たちは:
A = 24
B = 40
C = 35
D = 40
E = 35
F = 23
G = 35
H = 23
I = 32

編集:
ここではパズル自体の1つの形式ですが、少なくともこの問題を解決しようとすることができます。私はブルートフォースと6時間の計算で解決策を得ることができましたが、これは私が望んでいた方法ではありません。がんばろう:

## ## ## ## ## ## ##  
## 15 ## 28 ## 44 ##  
## ## ## ## ## ## ##  
## 33 ## 36 ## 36 ##  
## ## ## ## ## ## ##  
## 46 ## 31 ## 19 ##  
## ## ## ## ## ## ##
ベストアンサー

これは、 0-1整数線形計画問題として公式化することは非常に簡単です。ソルバー。最適化を目的とする機能がないため、
lp_solve では、

2134567
1-1-3-5
4123756
3-5-6-4
6572431
5-6-2-3
7645132

総額を最小にするように頼むと、

2143657
1-1-3-5
3124576
4-5-7-4
7563421
5-7-2-3
6735142

総額を最大にするように頼むと、

3125674
2-1-2-7
1234576
5-5-7-5
4765123
7-4-3-1
6571432

それは最長だった:0.9秒。

私は個々の変数を個別に最大化する解決策を見つけるために小さなスクリプトを書いています(最初は、左上隅に
1 を含む解決策を見つけようとします;そして次に 2
;など)、重複除外の結果、私は22のソリューションを残しました。これは、ソリューションの完全なセットであることは保証されていません(実際は上記の3つのソリューションのうちの1つだけを含む)。

1234567
2-1-2-6
3124765
5-4-6-4
6572413
4-6-3-1
7653142

1234576
2-1-2-7
3125674
6-4-7-3
4672315
5-6-1-2
7653421

1234576
2-1-3-5
3124657
4-5-7-4
5673241
6-4-4-2
7564123

1235467
2-1-3-6
3124675
4-5-7-4
6573241
5-6-1-3
7643512

2134567
1-1-3-5
4123756
3-5-6-4
6572431
5-6-2-3
7645132

2134567
1-2-2-6
3214765
4-5-6-4
5672431
6-4-3-2
7564123

2134675
1-2-3-6
3215467
5-5-7-4
4763512
7-4-1-3
6573241

2134675
1-2-3-6
3215467
6-4-7-4
4673512
5-6-2-1
7652143

2135467
1-1-3-6
4123765
3-6-6-4
7643521
6-5-2-3
5674132

2135467
1-2-3-6
3214675
6-4-7-2
4672513
5-6-2-1
7653124

2135674
1-2-2-7
3214576
4-5-7-5
5674312
6-4-4-1
7562143

2143567
1-1-2-6
3124765
4-5-6-4
5672341
6-6-1-3
7635412

2143567
1-1-2-6
3124765
4-5-6-4
7562413
5-7-3-1
6735142

2143576
1-1-3-5
3124657
6-3-7-4
5673421
4-6-2-3
7653142

2143657
1-1-3-5
3124576
4-5-7-3
6572431
7-6-2-2
5736124

3124567
1-1-2-6
2143765
5-3-6-4
6572413
4-6-3-1
7653142

3124576
1-1-3-5
2143657
4-6-7-4
6735241
5-7-4-2
7654123

3124576
1-1-3-5
2143657
4-6-7-4
7635241
5-7-4-2
6754123

3124576
1-1-3-5
2143657
5-3-7-4
7563412
6-5-1-3
4673251

3124657
1-1-3-5
2143576
5-3-7-4
6573421
4-6-2-3
7653142

3124675
2-1-1-7
1234756
4-5-5-4
5671423
6-4-2-2
7564321

3125674
1-1-2-7
2143576
5-3-7-5
6574321
4-6-1-3
7651432

3214675
1-2-1-7
2134756
4-5-5-4
5671423
6-4-2-2
7564321

私はパズルが手で行うのがとても難しい理由の良い部分は、それがどのセル値にコミットするにはあまりにも多くの解決策を持っているということです:バックトラックする準備が必要です。
“不完全な”行と列の非繰り返しに対する制約がないことは役に立ちません。反復が許されない場合、左上の 15
は非常に強い制約になります。その近隣は、8つの対称性の1つになる

123
2-1
312

しかし、あなたが見ることができるように、上記のソリューションの13はそのような形をしていません。

答えを自己完結型にするために、ここでは総和を最大化する目的で lp_solve
の入力ファイルを示します。パズルの異なるインスタンスを解決するために変更する必要のある値は、/*適切な合計*/に続く9行の値だけです。

max: 1 x001 + 2 x002 + 3 x003 + 4 x004 + 5 x005 + 6 x006 + 7 x007 + 1 x011 + 2 x012 + 3 x013 + 4 x014 + 5 x015 + 6 x016 + 7 x017 + 1 x021 + 2 x022 + 3 x023 + 4 x024 + 5 x025 + 6 x026 + 7 x027 + 1 x101 + 2 x102 + 3 x103 + 4 x104 + 5 x105 + 6 x106 + 7 x107 + 1 x121 + 2 x122 + 3 x123 + 4 x124 + 5 x125 + 6 x126 + 7 x127 + 1 x201 + 2 x202 + 3 x203 + 4 x204 + 5 x205 + 6 x206 + 7 x207 + 1 x211 + 2 x212 + 3 x213 + 4 x214 + 5 x215 + 6 x216 + 7 x217 + 1 x221 + 2 x222 + 3 x223 + 4 x224 + 5 x225 + 6 x226 + 7 x227 + 1 x031 + 2 x032 + 3 x033 + 4 x034 + 5 x035 + 6 x036 + 7 x037 + 1 x041 + 2 x042 + 3 x043 + 4 x044 + 5 x045 + 6 x046 + 7 x047 + 1 x141 + 2 x142 + 3 x143 + 4 x144 + 5 x145 + 6 x146 + 7 x147 + 1 x221 + 2 x222 + 3 x223 + 4 x224 + 5 x225 + 6 x226 + 7 x227 + 1 x231 + 2 x232 + 3 x233 + 4 x234 + 5 x235 + 6 x236 + 7 x237 + 1 x241 + 2 x242 + 3 x243 + 4 x244 + 5 x245 + 6 x246 + 7 x247 + 1 x051 + 2 x052 + 3 x053 + 4 x054 + 5 x055 + 6 x056 + 7 x057 + 1 x061 + 2 x062 + 3 x063 + 4 x064 + 5 x065 + 6 x066 + 7 x067 + 1 x161 + 2 x162 + 3 x163 + 4 x164 + 5 x165 + 6 x166 + 7 x167 + 1 x241 + 2 x242 + 3 x243 + 4 x244 + 5 x245 + 6 x246 + 7 x247 + 1 x251 + 2 x252 + 3 x253 + 4 x254 + 5 x255 + 6 x256 + 7 x257 + 1 x261 + 2 x262 + 3 x263 + 4 x264 + 5 x265 + 6 x266 + 7 x267 + 1 x301 + 2 x302 + 3 x303 + 4 x304 + 5 x305 + 6 x306 + 7 x307 + 1 x321 + 2 x322 + 3 x323 + 4 x324 + 5 x325 + 6 x326 + 7 x327 + 1 x401 + 2 x402 + 3 x403 + 4 x404 + 5 x405 + 6 x406 + 7 x407 + 1 x411 + 2 x412 + 3 x413 + 4 x414 + 5 x415 + 6 x416 + 7 x417 + 1 x421 + 2 x422 + 3 x423 + 4 x424 + 5 x425 + 6 x426 + 7 x427 + 1 x341 + 2 x342 + 3 x343 + 4 x344 + 5 x345 + 6 x346 + 7 x347 + 1 x421 + 2 x422 + 3 x423 + 4 x424 + 5 x425 + 6 x426 + 7 x427 + 1 x431 + 2 x432 + 3 x433 + 4 x434 + 5 x435 + 6 x436 + 7 x437 + 1 x441 + 2 x442 + 3 x443 + 4 x444 + 5 x445 + 6 x446 + 7 x447 + 1 x261 + 2 x262 + 3 x263 + 4 x264 + 5 x265 + 6 x266 + 7 x267 + 1 x361 + 2 x362 + 3 x363 + 4 x364 + 5 x365 + 6 x366 + 7 x367 + 1 x441 + 2 x442 + 3 x443 + 4 x444 + 5 x445 + 6 x446 + 7 x447 + 1 x451 + 2 x452 + 3 x453 + 4 x454 + 5 x455 + 6 x456 + 7 x457 + 1 x461 + 2 x462 + 3 x463 + 4 x464 + 5 x465 + 6 x466 + 7 x467 + 1 x501 + 2 x502 + 3 x503 + 4 x504 + 5 x505 + 6 x506 + 7 x507 + 1 x521 + 2 x522 + 3 x523 + 4 x524 + 5 x525 + 6 x526 + 7 x527 + 1 x601 + 2 x602 + 3 x603 + 4 x604 + 5 x605 + 6 x606 + 7 x607 + 1 x611 + 2 x612 + 3 x613 + 4 x614 + 5 x615 + 6 x616 + 7 x617 + 1 x621 + 2 x622 + 3 x623 + 4 x624 + 5 x625 + 6 x626 + 7 x627 + 1 x541 + 2 x542 + 3 x543 + 4 x544 + 5 x545 + 6 x546 + 7 x547 + 1 x621 + 2 x622 + 3 x623 + 4 x624 + 5 x625 + 6 x626 + 7 x627 + 1 x631 + 2 x632 + 3 x633 + 4 x634 + 5 x635 + 6 x636 + 7 x637 + 1 x641 + 2 x642 + 3 x643 + 4 x644 + 5 x645 + 6 x646 + 7 x647 + 1 x461 + 2 x462 + 3 x463 + 4 x464 + 5 x465 + 6 x466 + 7 x467 + 1 x561 + 2 x562 + 3 x563 + 4 x564 + 5 x565 + 6 x566 + 7 x567 + 1 x641 + 2 x642 + 3 x643 + 4 x644 + 5 x645 + 6 x646 + 7 x647 + 1 x651 + 2 x652 + 3 x653 + 4 x654 + 5 x655 + 6 x656 + 7 x657 + 1 x661 + 2 x662 + 3 x663 + 4 x664 + 5 x665 + 6 x666 + 7 x667;

/* Variable names are xrcv where r is the 0-indexed row, c is the 0-indexed column, and v is the 1-indexed value. */
/* The variables are binary (0-1), so precisely one of each xrc* is 1, and that gives the value at (r, c). */

x001 + x002 + x003 + x004 + x005 + x006 + x007 = 1;
x011 + x012 + x013 + x014 + x015 + x016 + x017 = 1;
x021 + x022 + x023 + x024 + x025 + x026 + x027 = 1;
x031 + x032 + x033 + x034 + x035 + x036 + x037 = 1;
x041 + x042 + x043 + x044 + x045 + x046 + x047 = 1;
x051 + x052 + x053 + x054 + x055 + x056 + x057 = 1;
x061 + x062 + x063 + x064 + x065 + x066 + x067 = 1;
x101 + x102 + x103 + x104 + x105 + x106 + x107 = 1;
x121 + x122 + x123 + x124 + x125 + x126 + x127 = 1;
x141 + x142 + x143 + x144 + x145 + x146 + x147 = 1;
x161 + x162 + x163 + x164 + x165 + x166 + x167 = 1;
x201 + x202 + x203 + x204 + x205 + x206 + x207 = 1;
x211 + x212 + x213 + x214 + x215 + x216 + x217 = 1;
x221 + x222 + x223 + x224 + x225 + x226 + x227 = 1;
x231 + x232 + x233 + x234 + x235 + x236 + x237 = 1;
x241 + x242 + x243 + x244 + x245 + x246 + x247 = 1;
x251 + x252 + x253 + x254 + x255 + x256 + x257 = 1;
x261 + x262 + x263 + x264 + x265 + x266 + x267 = 1;
x301 + x302 + x303 + x304 + x305 + x306 + x307 = 1;
x321 + x322 + x323 + x324 + x325 + x326 + x327 = 1;
x341 + x342 + x343 + x344 + x345 + x346 + x347 = 1;
x361 + x362 + x363 + x364 + x365 + x366 + x367 = 1;
x401 + x402 + x403 + x404 + x405 + x406 + x407 = 1;
x411 + x412 + x413 + x414 + x415 + x416 + x417 = 1;
x421 + x422 + x423 + x424 + x425 + x426 + x427 = 1;
x431 + x432 + x433 + x434 + x435 + x436 + x437 = 1;
x441 + x442 + x443 + x444 + x445 + x446 + x447 = 1;
x451 + x452 + x453 + x454 + x455 + x456 + x457 = 1;
x461 + x462 + x463 + x464 + x465 + x466 + x467 = 1;
x501 + x502 + x503 + x504 + x505 + x506 + x507 = 1;
x521 + x522 + x523 + x524 + x525 + x526 + x527 = 1;
x541 + x542 + x543 + x544 + x545 + x546 + x547 = 1;
x561 + x562 + x563 + x564 + x565 + x566 + x567 = 1;
x601 + x602 + x603 + x604 + x605 + x606 + x607 = 1;
x611 + x612 + x613 + x614 + x615 + x616 + x617 = 1;
x621 + x622 + x623 + x624 + x625 + x626 + x627 = 1;
x631 + x632 + x633 + x634 + x635 + x636 + x637 = 1;
x641 + x642 + x643 + x644 + x645 + x646 + x647 = 1;
x651 + x652 + x653 + x654 + x655 + x656 + x657 = 1;
x661 + x662 + x663 + x664 + x665 + x666 + x667 = 1;

/* No number repeats in a row */

x001 + x011 + x021 + x031 + x041 + x051 + x061 = 1;
x002 + x012 + x022 + x032 + x042 + x052 + x062 = 1;
x003 + x013 + x023 + x033 + x043 + x053 + x063 = 1;
x004 + x014 + x024 + x034 + x044 + x054 + x064 = 1;
x005 + x015 + x025 + x035 + x045 + x055 + x065 = 1;
x006 + x016 + x026 + x036 + x046 + x056 + x066 = 1;
x007 + x017 + x027 + x037 + x047 + x057 + x067 = 1;
x201 + x211 + x221 + x231 + x241 + x251 + x261 = 1;
x202 + x212 + x222 + x232 + x242 + x252 + x262 = 1;
x203 + x213 + x223 + x233 + x243 + x253 + x263 = 1;
x204 + x214 + x224 + x234 + x244 + x254 + x264 = 1;
x205 + x215 + x225 + x235 + x245 + x255 + x265 = 1;
x206 + x216 + x226 + x236 + x246 + x256 + x266 = 1;
x207 + x217 + x227 + x237 + x247 + x257 + x267 = 1;
x401 + x411 + x421 + x431 + x441 + x451 + x461 = 1;
x402 + x412 + x422 + x432 + x442 + x452 + x462 = 1;
x403 + x413 + x423 + x433 + x443 + x453 + x463 = 1;
x404 + x414 + x424 + x434 + x444 + x454 + x464 = 1;
x405 + x415 + x425 + x435 + x445 + x455 + x465 = 1;
x406 + x416 + x426 + x436 + x446 + x456 + x466 = 1;
x407 + x417 + x427 + x437 + x447 + x457 + x467 = 1;
x601 + x611 + x621 + x631 + x641 + x651 + x661 = 1;
x602 + x612 + x622 + x632 + x642 + x652 + x662 = 1;
x603 + x613 + x623 + x633 + x643 + x653 + x663 = 1;
x604 + x614 + x624 + x634 + x644 + x654 + x664 = 1;
x605 + x615 + x625 + x635 + x645 + x655 + x665 = 1;
x606 + x616 + x626 + x636 + x646 + x656 + x666 = 1;
x607 + x617 + x627 + x637 + x647 + x657 + x667 = 1;

/* No number repeats in a column */

x001 + x101 + x201 + x301 + x401 + x501 + x601 = 1;
x002 + x102 + x202 + x302 + x402 + x502 + x602 = 1;
x003 + x103 + x203 + x303 + x403 + x503 + x603 = 1;
x004 + x104 + x204 + x304 + x404 + x504 + x604 = 1;
x005 + x105 + x205 + x305 + x405 + x505 + x605 = 1;
x006 + x106 + x206 + x306 + x406 + x506 + x606 = 1;
x007 + x107 + x207 + x307 + x407 + x507 + x607 = 1;
x021 + x121 + x221 + x321 + x421 + x521 + x621 = 1;
x022 + x122 + x222 + x322 + x422 + x522 + x622 = 1;
x023 + x123 + x223 + x323 + x423 + x523 + x623 = 1;
x024 + x124 + x224 + x324 + x424 + x524 + x624 = 1;
x025 + x125 + x225 + x325 + x425 + x525 + x625 = 1;
x026 + x126 + x226 + x326 + x426 + x526 + x626 = 1;
x027 + x127 + x227 + x327 + x427 + x527 + x627 = 1;
x041 + x141 + x241 + x341 + x441 + x541 + x641 = 1;
x042 + x142 + x242 + x342 + x442 + x542 + x642 = 1;
x043 + x143 + x243 + x343 + x443 + x543 + x643 = 1;
x044 + x144 + x244 + x344 + x444 + x544 + x644 = 1;
x045 + x145 + x245 + x345 + x445 + x545 + x645 = 1;
x046 + x146 + x246 + x346 + x446 + x546 + x646 = 1;
x047 + x147 + x247 + x347 + x447 + x547 + x647 = 1;
x061 + x161 + x261 + x361 + x461 + x561 + x661 = 1;
x062 + x162 + x262 + x362 + x462 + x562 + x662 = 1;
x063 + x163 + x263 + x363 + x463 + x563 + x663 = 1;
x064 + x164 + x264 + x364 + x464 + x564 + x664 = 1;
x065 + x165 + x265 + x365 + x465 + x565 + x665 = 1;
x066 + x166 + x266 + x366 + x466 + x566 + x666 = 1;
x067 + x167 + x267 + x367 + x467 + x567 + x667 = 1;

/* Appropriate totals */

1 x001 + 2 x002 + 3 x003 + 4 x004 + 5 x005 + 6 x006 + 7 x007 + 1 x011 + 2 x012 + 3 x013 + 4 x014 + 5 x015 + 6 x016 + 7 x017 + 1 x021 + 2 x022 + 3 x023 + 4 x024 + 5 x025 + 6 x026 + 7 x027 + 1 x101 + 2 x102 + 3 x103 + 4 x104 + 5 x105 + 6 x106 + 7 x107 + 1 x121 + 2 x122 + 3 x123 + 4 x124 + 5 x125 + 6 x126 + 7 x127 + 1 x201 + 2 x202 + 3 x203 + 4 x204 + 5 x205 + 6 x206 + 7 x207 + 1 x211 + 2 x212 + 3 x213 + 4 x214 + 5 x215 + 6 x216 + 7 x217 + 1 x221 + 2 x222 + 3 x223 + 4 x224 + 5 x225 + 6 x226 + 7 x227 = 15;
1 x021 + 2 x022 + 3 x023 + 4 x024 + 5 x025 + 6 x026 + 7 x027 + 1 x031 + 2 x032 + 3 x033 + 4 x034 + 5 x035 + 6 x036 + 7 x037 + 1 x041 + 2 x042 + 3 x043 + 4 x044 + 5 x045 + 6 x046 + 7 x047 + 1 x121 + 2 x122 + 3 x123 + 4 x124 + 5 x125 + 6 x126 + 7 x127 + 1 x141 + 2 x142 + 3 x143 + 4 x144 + 5 x145 + 6 x146 + 7 x147 + 1 x221 + 2 x222 + 3 x223 + 4 x224 + 5 x225 + 6 x226 + 7 x227 + 1 x231 + 2 x232 + 3 x233 + 4 x234 + 5 x235 + 6 x236 + 7 x237 + 1 x241 + 2 x242 + 3 x243 + 4 x244 + 5 x245 + 6 x246 + 7 x247 = 28;
1 x041 + 2 x042 + 3 x043 + 4 x044 + 5 x045 + 6 x046 + 7 x047 + 1 x051 + 2 x052 + 3 x053 + 4 x054 + 5 x055 + 6 x056 + 7 x057 + 1 x061 + 2 x062 + 3 x063 + 4 x064 + 5 x065 + 6 x066 + 7 x067 + 1 x141 + 2 x142 + 3 x143 + 4 x144 + 5 x145 + 6 x146 + 7 x147 + 1 x161 + 2 x162 + 3 x163 + 4 x164 + 5 x165 + 6 x166 + 7 x167 + 1 x241 + 2 x242 + 3 x243 + 4 x244 + 5 x245 + 6 x246 + 7 x247 + 1 x251 + 2 x252 + 3 x253 + 4 x254 + 5 x255 + 6 x256 + 7 x257 + 1 x261 + 2 x262 + 3 x263 + 4 x264 + 5 x265 + 6 x266 + 7 x267 = 44;
1 x201 + 2 x202 + 3 x203 + 4 x204 + 5 x205 + 6 x206 + 7 x207 + 1 x211 + 2 x212 + 3 x213 + 4 x214 + 5 x215 + 6 x216 + 7 x217 + 1 x221 + 2 x222 + 3 x223 + 4 x224 + 5 x225 + 6 x226 + 7 x227 + 1 x301 + 2 x302 + 3 x303 + 4 x304 + 5 x305 + 6 x306 + 7 x307 + 1 x321 + 2 x322 + 3 x323 + 4 x324 + 5 x325 + 6 x326 + 7 x327 + 1 x401 + 2 x402 + 3 x403 + 4 x404 + 5 x405 + 6 x406 + 7 x407 + 1 x411 + 2 x412 + 3 x413 + 4 x414 + 5 x415 + 6 x416 + 7 x417 + 1 x421 + 2 x422 + 3 x423 + 4 x424 + 5 x425 + 6 x426 + 7 x427 = 33;
1 x221 + 2 x222 + 3 x223 + 4 x224 + 5 x225 + 6 x226 + 7 x227 + 1 x231 + 2 x232 + 3 x233 + 4 x234 + 5 x235 + 6 x236 + 7 x237 + 1 x241 + 2 x242 + 3 x243 + 4 x244 + 5 x245 + 6 x246 + 7 x247 + 1 x321 + 2 x322 + 3 x323 + 4 x324 + 5 x325 + 6 x326 + 7 x327 + 1 x341 + 2 x342 + 3 x343 + 4 x344 + 5 x345 + 6 x346 + 7 x347 + 1 x421 + 2 x422 + 3 x423 + 4 x424 + 5 x425 + 6 x426 + 7 x427 + 1 x431 + 2 x432 + 3 x433 + 4 x434 + 5 x435 + 6 x436 + 7 x437 + 1 x441 + 2 x442 + 3 x443 + 4 x444 + 5 x445 + 6 x446 + 7 x447 = 36;
1 x241 + 2 x242 + 3 x243 + 4 x244 + 5 x245 + 6 x246 + 7 x247 + 1 x251 + 2 x252 + 3 x253 + 4 x254 + 5 x255 + 6 x256 + 7 x257 + 1 x261 + 2 x262 + 3 x263 + 4 x264 + 5 x265 + 6 x266 + 7 x267 + 1 x341 + 2 x342 + 3 x343 + 4 x344 + 5 x345 + 6 x346 + 7 x347 + 1 x361 + 2 x362 + 3 x363 + 4 x364 + 5 x365 + 6 x366 + 7 x367 + 1 x441 + 2 x442 + 3 x443 + 4 x444 + 5 x445 + 6 x446 + 7 x447 + 1 x451 + 2 x452 + 3 x453 + 4 x454 + 5 x455 + 6 x456 + 7 x457 + 1 x461 + 2 x462 + 3 x463 + 4 x464 + 5 x465 + 6 x466 + 7 x467 = 36;
1 x401 + 2 x402 + 3 x403 + 4 x404 + 5 x405 + 6 x406 + 7 x407 + 1 x411 + 2 x412 + 3 x413 + 4 x414 + 5 x415 + 6 x416 + 7 x417 + 1 x421 + 2 x422 + 3 x423 + 4 x424 + 5 x425 + 6 x426 + 7 x427 + 1 x501 + 2 x502 + 3 x503 + 4 x504 + 5 x505 + 6 x506 + 7 x507 + 1 x521 + 2 x522 + 3 x523 + 4 x524 + 5 x525 + 6 x526 + 7 x527 + 1 x601 + 2 x602 + 3 x603 + 4 x604 + 5 x605 + 6 x606 + 7 x607 + 1 x611 + 2 x612 + 3 x613 + 4 x614 + 5 x615 + 6 x616 + 7 x617 + 1 x621 + 2 x622 + 3 x623 + 4 x624 + 5 x625 + 6 x626 + 7 x627 = 46;
1 x421 + 2 x422 + 3 x423 + 4 x424 + 5 x425 + 6 x426 + 7 x427 + 1 x431 + 2 x432 + 3 x433 + 4 x434 + 5 x435 + 6 x436 + 7 x437 + 1 x441 + 2 x442 + 3 x443 + 4 x444 + 5 x445 + 6 x446 + 7 x447 + 1 x521 + 2 x522 + 3 x523 + 4 x524 + 5 x525 + 6 x526 + 7 x527 + 1 x541 + 2 x542 + 3 x543 + 4 x544 + 5 x545 + 6 x546 + 7 x547 + 1 x621 + 2 x622 + 3 x623 + 4 x624 + 5 x625 + 6 x626 + 7 x627 + 1 x631 + 2 x632 + 3 x633 + 4 x634 + 5 x635 + 6 x636 + 7 x637 + 1 x641 + 2 x642 + 3 x643 + 4 x644 + 5 x645 + 6 x646 + 7 x647 = 31;
1 x441 + 2 x442 + 3 x443 + 4 x444 + 5 x445 + 6 x446 + 7 x447 + 1 x451 + 2 x452 + 3 x453 + 4 x454 + 5 x455 + 6 x456 + 7 x457 + 1 x461 + 2 x462 + 3 x463 + 4 x464 + 5 x465 + 6 x466 + 7 x467 + 1 x541 + 2 x542 + 3 x543 + 4 x544 + 5 x545 + 6 x546 + 7 x547 + 1 x561 + 2 x562 + 3 x563 + 4 x564 + 5 x565 + 6 x566 + 7 x567 + 1 x641 + 2 x642 + 3 x643 + 4 x644 + 5 x645 + 6 x646 + 7 x647 + 1 x651 + 2 x652 + 3 x653 + 4 x654 + 5 x655 + 6 x656 + 7 x657 + 1 x661 + 2 x662 + 3 x663 + 4 x664 + 5 x665 + 6 x666 + 7 x667 = 19;

/* Variables are 0-1 */

bin x001, x002, x003, x004, x005, x006, x007;
bin x011, x012, x013, x014, x015, x016, x017;
bin x021, x022, x023, x024, x025, x026, x027;
bin x031, x032, x033, x034, x035, x036, x037;
bin x041, x042, x043, x044, x045, x046, x047;
bin x051, x052, x053, x054, x055, x056, x057;
bin x061, x062, x063, x064, x065, x066, x067;
bin x101, x102, x103, x104, x105, x106, x107;
bin x121, x122, x123, x124, x125, x126, x127;
bin x141, x142, x143, x144, x145, x146, x147;
bin x161, x162, x163, x164, x165, x166, x167;
bin x201, x202, x203, x204, x205, x206, x207;
bin x211, x212, x213, x214, x215, x216, x217;
bin x221, x222, x223, x224, x225, x226, x227;
bin x231, x232, x233, x234, x235, x236, x237;
bin x241, x242, x243, x244, x245, x246, x247;
bin x251, x252, x253, x254, x255, x256, x257;
bin x261, x262, x263, x264, x265, x266, x267;
bin x301, x302, x303, x304, x305, x306, x307;
bin x321, x322, x323, x324, x325, x326, x327;
bin x341, x342, x343, x344, x345, x346, x347;
bin x361, x362, x363, x364, x365, x366, x367;
bin x401, x402, x403, x404, x405, x406, x407;
bin x411, x412, x413, x414, x415, x416, x417;
bin x421, x422, x423, x424, x425, x426, x427;
bin x431, x432, x433, x434, x435, x436, x437;
bin x441, x442, x443, x444, x445, x446, x447;
bin x451, x452, x453, x454, x455, x456, x457;
bin x461, x462, x463, x464, x465, x466, x467;
bin x501, x502, x503, x504, x505, x506, x507;
bin x521, x522, x523, x524, x525, x526, x527;
bin x541, x542, x543, x544, x545, x546, x547;
bin x561, x562, x563, x564, x565, x566, x567;
bin x601, x602, x603, x604, x605, x606, x607;
bin x611, x612, x613, x614, x615, x616, x617;
bin x621, x622, x623, x624, x625, x626, x627;
bin x631, x632, x633, x634, x635, x636, x637;
bin x641, x642, x643, x644, x645, x646, x647;
bin x651, x652, x653, x654, x655, x656, x657;
bin x661, x662, x663, x664, x665, x666, x667;

返信を残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です