La génialité de l'explosion combinée https://qiita.com/kaizen_nagoya/items/f309b0c2bb015bbc71c3
alors,
J'ai essayé d'utiliser le graphillion https://qiita.com/cabernet_rock/items/50f955afc16287244154
A été transformé en un fichier.
Rien ne sort quand je le lance.
Impression ajoutée.
gra.py
# https://qiita.com/cabernet_rock/items/50f955afc16287244154
#Importer les modules requis
from graphillion import GraphSet
import graphillion.tutorial as tl
import time #Vérifiez le temps de calcul.
#Spécifiez la taille de la grille
universe = tl.grid(2, 2)
GraphSet.set_universe(universe)
tl.draw(universe)
start = 1 #La position de départ
goal = 9 #Position de l'objectif
paths = GraphSet.paths(start, goal)
print (len(paths))
#
key = 4 #1ère place
treasure = 2 #2ème place
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(8, 8) #Grille 9x9
GraphSet.set_universe(universe)
start = 1
goal = 81
s = time.time() #Heure de début du calcul
print (paths = GraphSet.paths(start, goal))
time.time() - s #Temps de calcul
print (len(paths))
docker/ubuntu
# python3 gra.py
12
2
Traceback (most recent call last):
File "gra.py", line 26, in <module>
print (paths = GraphSet.paths(start, goal))
TypeError: 'paths' is an invalid keyword argument for this function
print (paths = GraphSet.paths(start, goal))
À
paths = GraphSet.paths(start, goal) print (paths)
changer en.