by Anonymous » 17 Mar 2025, 14:37
Ich definiere manuell die folgenden 16 Matrizen in Python: < /p>
Code: Select all
matrices = {
"Simulation 1": [
[1, 1, 1, 1, 1, 2],
[1, 1, 1, 1, 2, 2],
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 2, 3, 2],
[1, 1, 1, 1, 3, 3],
[1, 1, 1, 1, 3, 3]
],
"Simulation 2": [
[1, 1, 2, 2, 2, 2],
[1, 1, 1, 2, 2, 2],
[1, 1, 2, 2, 2, 2],
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 2, 2, 3],
[1, 1, 1, 3, 3, 3]
],
"Simulation 3": [
[1, 1, 2, 2, 2, 2],
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 2, 3, 3],
[1, 1, 2, 2, 3, 3],
[1, 1, 1, 3, 3, 3],
[1, 1, 3, 3, 3, 3]
],
"Simulation 4": [
[1, 1, 1, 1, 2, 2],
[1, 1, 1, 2, 2, 2],
[3, 1, 3, 3, 3, 2],
[3, 3, 3, 3, 3, 2],
[3, 3, 3, 3, 3, 2],
[3, 3, 3, 3, 3, 3]
],
"Simulation 5": [
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 1, 3, 2],
[1, 3, 3, 3, 3, 3],
[3, 3, 3, 3, 3, 3],
[3, 3, 3, 3, 3, 3]
],
"Simulation 6": [
[1, 1, 1, 1, 1, 2],
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 1, 2, 2],
[1, 1, 1, 1, 2, 3],
[1, 3, 3, 3, 3, 3],
[1, 3, 3, 3, 3, 3]
],
"Simulation 7": [
[1, 1, 1, 1, 2, 2],
[1, 1, 1, 1, 1, 2],
[1, 1, 1, 2, 2, 2],
[1, 1, 3, 2, 2, 3],
[1, 1, 3, 3, 3, 3],
[3, 3, 3, 3, 3, 3]
],
"Simulation 8": [
[1, 1, 2, 2, 2, 2],
[2, 2, 2, 2, 2, 2],
[2, 2, 2, 2, 2, 2],
[2, 2, 2, 2, 3, 3],
[2, 2, 3, 3, 3, 3],
[2, 2, 2, 3, 3, 3]
],
"Simulation 9": [
[1, 1, 2, 2, 2, 2],
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 1, 2, 2],
[1, 1, 1, 1, 3, 2],
[1, 1, 1, 1, 3, 3],
[1, 1, 3, 3, 3, 3]
],
"Simulation 10": [
[1, 1, 1, 2, 2, 2],
[1, 1, 2, 2, 2, 2],
[1, 1, 2, 2, 2, 2],
[1, 1, 2, 2, 2, 3],
[1, 1, 1, 1, 3, 3],
[1, 1, 1, 3, 3, 3]
],
"Simulation 11": [
[1, 1, 1, 2, 2, 2],
[1, 1, 2, 2, 2, 2],
[1, 1, 2, 2, 2, 3],
[1, 1, 1, 2, 3, 3],
[1, 1, 1, 3, 3, 3],
[1, 1, 1, 3, 3, 3]
],
"Simulation 12": [
[1, 1, 1, 1, 2, 2],
[1, 1, 1, 1, 2, 2],
[1, 1, 1, 1, 2, 2],
[3, 1, 1, 3, 3, 3],
[3, 3, 3, 3, 3, 3],
[3, 3, 3, 3, 3, 3]
],
"Simulation 13": [
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 1, 2, 2],
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 3, 3, 3],
[1, 3, 3, 3, 3, 3],
[3, 3, 3, 3, 3, 3]
],
"Simulation 14": [
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 1, 1, 2],
[1, 1, 1, 1, 1, 2],
[1, 1, 1, 3, 3, 2],
[1, 3, 3, 3, 3, 3],
[1, 3, 3, 3, 3, 3]
],
"Simulation 15": [
[1, 1, 1, 2, 2, 2],
[1, 2, 2, 2, 2, 2],
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 1, 3, 3],
[1, 1, 1, 3, 3, 3],
[1, 1, 1, 3, 3, 3]
],
"Simulation 16": [
[1, 1, 3, 2, 2, 2],
[1, 1, 3, 2, 3, 3],
[1, 1, 3, 3, 3, 3],
[1, 1, 3, 3, 3, 3],
[1, 1, 3, 3, 3, 3],
[1, 1, 3, 3, 3, 3]
]
}
Wenn sich diese visualisiert, sehen diese so aus:
Positions.
Code: Select all
positions = [
[1, 2, 3, 4, 5, 6],
[7, 8, 9, 10, 11, 12],
[13, 14, 15, 16, 17, 18],
[19, 20, 21, 22, 23, 24],
[25, 26, 27, 28, 29, 30],
[31, 32, 33, 34, 35, 36]
]
< /code>
Diese Matrizen haben die folgenden Eigenschaften: < /p>
[list]
[*] 1 = rot, 2 = blau, 3 = grün < /li>
Position 1 ist immer rot, Position 6 ist immer blau und Position 36 ist immer grün. Farbe
[/list]
Hier ist ein Beispiel für eine ungültige Matrix (d. H. Knoten 1 (rot) kann die anderen roten Knoten nicht erreichen, ohne auf Blau zu treten):
Ich definiere manuell die folgenden 16 Matrizen in Python: < /p>
[code]matrices = {
"Simulation 1": [
[1, 1, 1, 1, 1, 2],
[1, 1, 1, 1, 2, 2],
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 2, 3, 2],
[1, 1, 1, 1, 3, 3],
[1, 1, 1, 1, 3, 3]
],
"Simulation 2": [
[1, 1, 2, 2, 2, 2],
[1, 1, 1, 2, 2, 2],
[1, 1, 2, 2, 2, 2],
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 2, 2, 3],
[1, 1, 1, 3, 3, 3]
],
"Simulation 3": [
[1, 1, 2, 2, 2, 2],
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 2, 3, 3],
[1, 1, 2, 2, 3, 3],
[1, 1, 1, 3, 3, 3],
[1, 1, 3, 3, 3, 3]
],
"Simulation 4": [
[1, 1, 1, 1, 2, 2],
[1, 1, 1, 2, 2, 2],
[3, 1, 3, 3, 3, 2],
[3, 3, 3, 3, 3, 2],
[3, 3, 3, 3, 3, 2],
[3, 3, 3, 3, 3, 3]
],
"Simulation 5": [
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 1, 3, 2],
[1, 3, 3, 3, 3, 3],
[3, 3, 3, 3, 3, 3],
[3, 3, 3, 3, 3, 3]
],
"Simulation 6": [
[1, 1, 1, 1, 1, 2],
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 1, 2, 2],
[1, 1, 1, 1, 2, 3],
[1, 3, 3, 3, 3, 3],
[1, 3, 3, 3, 3, 3]
],
"Simulation 7": [
[1, 1, 1, 1, 2, 2],
[1, 1, 1, 1, 1, 2],
[1, 1, 1, 2, 2, 2],
[1, 1, 3, 2, 2, 3],
[1, 1, 3, 3, 3, 3],
[3, 3, 3, 3, 3, 3]
],
"Simulation 8": [
[1, 1, 2, 2, 2, 2],
[2, 2, 2, 2, 2, 2],
[2, 2, 2, 2, 2, 2],
[2, 2, 2, 2, 3, 3],
[2, 2, 3, 3, 3, 3],
[2, 2, 2, 3, 3, 3]
],
"Simulation 9": [
[1, 1, 2, 2, 2, 2],
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 1, 2, 2],
[1, 1, 1, 1, 3, 2],
[1, 1, 1, 1, 3, 3],
[1, 1, 3, 3, 3, 3]
],
"Simulation 10": [
[1, 1, 1, 2, 2, 2],
[1, 1, 2, 2, 2, 2],
[1, 1, 2, 2, 2, 2],
[1, 1, 2, 2, 2, 3],
[1, 1, 1, 1, 3, 3],
[1, 1, 1, 3, 3, 3]
],
"Simulation 11": [
[1, 1, 1, 2, 2, 2],
[1, 1, 2, 2, 2, 2],
[1, 1, 2, 2, 2, 3],
[1, 1, 1, 2, 3, 3],
[1, 1, 1, 3, 3, 3],
[1, 1, 1, 3, 3, 3]
],
"Simulation 12": [
[1, 1, 1, 1, 2, 2],
[1, 1, 1, 1, 2, 2],
[1, 1, 1, 1, 2, 2],
[3, 1, 1, 3, 3, 3],
[3, 3, 3, 3, 3, 3],
[3, 3, 3, 3, 3, 3]
],
"Simulation 13": [
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 1, 2, 2],
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 3, 3, 3],
[1, 3, 3, 3, 3, 3],
[3, 3, 3, 3, 3, 3]
],
"Simulation 14": [
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 1, 1, 2],
[1, 1, 1, 1, 1, 2],
[1, 1, 1, 3, 3, 2],
[1, 3, 3, 3, 3, 3],
[1, 3, 3, 3, 3, 3]
],
"Simulation 15": [
[1, 1, 1, 2, 2, 2],
[1, 2, 2, 2, 2, 2],
[1, 1, 1, 2, 2, 2],
[1, 1, 1, 1, 3, 3],
[1, 1, 1, 3, 3, 3],
[1, 1, 1, 3, 3, 3]
],
"Simulation 16": [
[1, 1, 3, 2, 2, 2],
[1, 1, 3, 2, 3, 3],
[1, 1, 3, 3, 3, 3],
[1, 1, 3, 3, 3, 3],
[1, 1, 3, 3, 3, 3],
[1, 1, 3, 3, 3, 3]
]
}
[/code]
Wenn sich diese visualisiert, sehen diese so aus:
Positions.[code]positions = [
[1, 2, 3, 4, 5, 6],
[7, 8, 9, 10, 11, 12],
[13, 14, 15, 16, 17, 18],
[19, 20, 21, 22, 23, 24],
[25, 26, 27, 28, 29, 30],
[31, 32, 33, 34, 35, 36]
]
< /code>
Diese Matrizen haben die folgenden Eigenschaften: < /p>
[list]
[*] 1 = rot, 2 = blau, 3 = grün < /li>
Position 1 ist immer rot, Position 6 ist immer blau und Position 36 ist immer grün. Farbe
[/list]
Hier ist ein Beispiel für eine ungültige Matrix (d. H. Knoten 1 (rot) kann die anderen roten Knoten nicht erreichen, ohne auf Blau zu treten):