{
  "id": "explicit-five",
  "title": "Five cities with an explicit full distance matrix",
  "input": {
    "path": "formats/tsplib/cases/explicit-five/input.txt",
    "text": "NAME : handmade-explicit-five\nTYPE : TSP\nCOMMENT : Hand-made symmetric distances\nDIMENSION : 5\nEDGE_WEIGHT_TYPE : EXPLICIT\nEDGE_WEIGHT_FORMAT : FULL_MATRIX\nEDGE_WEIGHT_SECTION\n0 2 4 6 3\n2 0 5 4 7\n4 5 0 3 6\n6 4 3 0 2\n3 7 6 2 0\nEOF\n"
  },
  "params": [],
  "commands": {
    "readJson": "iris read formats/tsplib/tsplib.iris formats/tsplib/cases/explicit-five/input.txt --json",
    "readDzn": "iris read formats/tsplib/tsplib.iris formats/tsplib/cases/explicit-five/input.txt --dzn",
    "readSummary": "iris read formats/tsplib/tsplib.iris formats/tsplib/cases/explicit-five/input.txt --summary",
    "errorJson": null
  },
  "result": {
    "kind": "success",
    "json": "{\"iris\":\"0.1\",\"entries\":[{\"name\":\"name\",\"type\":\"string\",\"depth\":0,\"value\":\"handmade-explicit-five\"},{\"name\":\"type\",\"type\":\"string\",\"depth\":0,\"value\":\"TSP\"},{\"name\":\"n\",\"type\":\"int\",\"depth\":0,\"value\":5},{\"name\":\"edge_weight_type\",\"type\":\"string\",\"depth\":0,\"value\":\"EXPLICIT\"},{\"name\":\"edge_weight_format\",\"type\":\"string\",\"depth\":0,\"value\":\"FULL_MATRIX\"},{\"name\":\"weight\",\"type\":\"int\",\"depth\":2,\"value\":[[0,2,4,6,3],[2,0,5,4,7],[4,5,0,3,6],[6,4,3,0,2],[3,7,6,2,0]]}]}\n",
    "dzn": "name = \"handmade-explicit-five\";\n'type' = \"TSP\";\nn = 5;\nedge_weight_type = \"EXPLICIT\";\nedge_weight_format = \"FULL_MATRIX\";\nweight = [| 0, 2, 4, 6, 3\n  | 2, 0, 5, 4, 7\n  | 4, 5, 0, 3, 6\n  | 6, 4, 3, 0, 2\n  | 3, 7, 6, 2, 0 |];\n",
    "summary": "formats/tsplib/cases/explicit-five/input.txt [tsplib]\n  name: string \"handmade-explicit-five\"\n  type: string \"TSP\"\n  n: int 5\n  edge_weight_type: string \"EXPLICIT\"\n  edge_weight_format: string \"FULL_MATRIX\"\n  weight: int array 5 x 5\n"
  },
  "catalog": null,
  "downloads": {
    "input": "/examples/formats/tsplib/cases/explicit-five/input.txt",
    "spec": "/examples/formats/tsplib/tsplib.iris",
    "data.json": "/examples/formats/tsplib/cases/explicit-five/data.json",
    "data.dzn": "/examples/formats/tsplib/cases/explicit-five/data.dzn",
    "summary.txt": "/examples/formats/tsplib/cases/explicit-five/summary.txt",
    "case": "/examples/formats/tsplib/cases/explicit-five/case.json"
  },
  "spec": {
    "path": "formats/tsplib/tsplib.iris",
    "text": "format tsplib\n\ncomment \"COMMENT\"\nsections until \"EOF\" {\n  \"NAME : {name:rest}\" optional\n  \"TYPE : {type:word}\" optional\n  \"DIMENSION : {n:2..46340}\"\n  \"EDGE_WEIGHT_TYPE : {edge_weight_type:word}\" optional\n  \"EDGE_WEIGHT_FORMAT : {edge_weight_format:word}\" optional\n  \"NODE_COORD_TYPE : {node_coord_type:word}\" optional\n  \"DISPLAY_DATA_TYPE : {display_data_type:word}\" optional\n  \"NODE_COORD_SECTION\" optional {\n    repeat n {\n      node: int\n      x: float\n      y: float\n    }\n  }\n  \"EDGE_WEIGHT_SECTION\" optional {\n    if !defined(edge_weight_format) {\n      let edge_weight_format = \"FULL_MATRIX\"\n    }\n    weight[n][n]: 0..gecode.int_max / n layout edge_weight_format\n  }\n  \"DISPLAY_DATA_SECTION\" optional {\n    repeat n {\n      display_node: int\n      display_x: float\n      display_y: float\n    }\n  }\n}\nif !defined(edge_weight_type) {\n  let edge_weight_type = \"EXPLICIT\"\n}\n\nif edge_weight_type == \"EXPLICIT\" {\n  check defined(weight) \"no EDGE_WEIGHT_SECTION\"\n  check size(weight) == n \"edge weights do not match DIMENSION\"\n} else {\n  check edge_weight_type == \"EUC_2D\" ||\n    edge_weight_type == \"CEIL_2D\" ||\n    edge_weight_type == \"ATT\" ||\n    edge_weight_type == \"GEO\"\n    \"EDGE_WEIGHT_TYPE must be EXPLICIT, EUC_2D, CEIL_2D, ATT, or GEO\"\n  check defined(x) \"no NODE_COORD_SECTION\"\n  check size(x) == n \"coordinates do not match DIMENSION\"\n  check x >= -1e9 && x <= 1e9 && y >= -1e9 && y <= 1e9 \"coordinates must be between -1e9 and 1e9\"\n}\n"
  }
}
