Zum Inhalt
HALOWERK

Datenvertragswerk

adjacent swap permutation tour

For 0 to 5 labels starting at zero, construct the whole Steinhaus-Johnson-Trotter permutation tour from identity. Each transition swaps the largest mobile value with its adjacent smaller neighbor, then reverses directions of greater values. Own direction convention stores -1 or +1 by value, initially all -1; blocked values retain direction. Return every permutation, direction vector, incoming pair of zero-based adjacent positions and moved value. For n>=2 return the closing swap back to.

POST https://datenvertrag.halowerk.com/v1/adjacent-swap-permutation-tour

Eingaben

Felder des veröffentlichten Eingabeschemas
FeldTypPflichtBeschreibung
sizeSiehe SchemaJa
claimed_permutationsSiehe SchemaJa
Vollständiges Eingabeschema anzeigen
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "size",
    "claimed_permutations"
  ],
  "properties": {
    "size": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 0,
          "maximum": 5
        },
        {
          "type": "null"
        }
      ]
    },
    "claimed_permutations": {
      "anyOf": [
        {
          "type": "array",
          "maxItems": 120,
          "items": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 4
            }
          }
        },
        {
          "type": "null"
        }
      ]
    }
  }
}

Originalschema öffnen

Veröffentlichtes Eingabebeispiel

{
  "size": 3,
  "claimed_permutations": [
    [
      0,
      1,
      2
    ],
    [
      0,
      2,
      1
    ],
    [
      2,
      0,
      1
    ],
    [
      2,
      1,
      0
    ],
    [
      1,
      2,
      0
    ],
    [
      1,
      0,
      2
    ]
  ]
}

Ergebnis & Dokumentation

Maschinenlesbare Dokumentation dieses Hubs

Quelle dieser Seite: der veröffentlichte HALOWERK-Katalog. Stand: 2026-11-07, 02:42 UTC.

Weitere Endpunkte dieses Hubs

Alle Endpunkte dieses Hubs →