LoginSignup
0
1

More than 3 years have passed since last update.

今日のpython error: killed

Last updated at Posted at 2020-01-22

『フカシギの数え方』 おねえさんといっしょ:組み合わせ爆発の凄さ
https://qiita.com/kaizen_nagoya/items/f309b0c2bb015bbc71c3

gra10.py
# https://qiita.com/cabernet_rock/items/50f955afc16287244154
# https://qiita.com/kaizen_nagoya/items/f309b0c2bb015bbc71c3
# https://qiita.com/kaizen_nagoya/items/3a8d89f095489b6e1f56
# https://qiita.com/kaizen_nagoya/items/819f10124ec453b7ef27

# 必要なモジュールのインポート
from graphillion import GraphSet
import graphillion.tutorial as tl
import time              # 計算時間を調べる。
# グリッドのサイズを指定
universe = tl.grid(2, 2)
GraphSet.set_universe(universe)
tl.draw(universe)
start = 1 # スタート位置
goal = 9 # ゴールの位置
paths = GraphSet.paths(start, goal)
print (len(paths))
#
key = 4        # 1箇所目
treasure = 2   # 2箇所目
paths_to_key = GraphSet.paths(start, key).excluding(treasure)
treasure_paths = paths.including(paths_to_key).including(treasure)
print (len(treasure_paths))
#
universe = tl.grid(9, 9) # 9×9のグリッド
GraphSet.set_universe(universe)
start = 1
goal = 100
s = time.time()          # 計算開始時刻
paths = GraphSet.paths(start, goal)
print (time.time() - s )# 計算時間

9X9が12時間たっても答えが出なかった。

graat.sh
#!/bin/bash
# https://qiita.com/kaizen_nagoya/items/f309b0c2bb015bbc71c3

date
python3 gra10.py
date

仕事ができないので、別の機材をdocker 12G Bにして、上記script実行。

Wed Jan 22 02:44:58 UTC 2020
12
2
./graat.sh: line 4:    22 Killed                  python3 gra10.py
Wed Jan 22 02:47:29 UTC 2020

14G Bにして

Wed Jan 22 03:03:49 UTC 2020
12
2
./graat.sh: line 4:    14 Killed                  python3 gra10.py
Wed Jan 22 03:08:19 UTC 2020

dockerの版が違うからかと思い、元の機材でやり直したら、昨日は12時間以上動いて停止してないのに、
今日は数分でkilled。理由不明。

文書履歴(document history)

ver. 0.01 初稿 20200122午前
ver. 0.02 script 追記 20200122 昼
ver. 0.03 python 追記 20200122 午後

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1