format tsplib comment "COMMENT" sections until "EOF" { "NAME : {name:rest}" optional "TYPE : {type:word}" optional "DIMENSION : {n:2..46340}" "EDGE_WEIGHT_TYPE : {edge_weight_type:word}" optional "EDGE_WEIGHT_FORMAT : {edge_weight_format:word}" optional "NODE_COORD_TYPE : {node_coord_type:word}" optional "DISPLAY_DATA_TYPE : {display_data_type:word}" optional "NODE_COORD_SECTION" optional { repeat n { node: int x: float y: float } } "EDGE_WEIGHT_SECTION" optional { if !defined(edge_weight_format) { let edge_weight_format = "FULL_MATRIX" } weight[n][n]: 0..gecode.int_max / n layout edge_weight_format } "DISPLAY_DATA_SECTION" optional { repeat n { display_node: int display_x: float display_y: float } } } if !defined(edge_weight_type) { let edge_weight_type = "EXPLICIT" } if edge_weight_type == "EXPLICIT" { check defined(weight) "no EDGE_WEIGHT_SECTION" check size(weight) == n "edge weights do not match DIMENSION" } else { check edge_weight_type == "EUC_2D" || edge_weight_type == "CEIL_2D" || edge_weight_type == "ATT" || edge_weight_type == "GEO" "EDGE_WEIGHT_TYPE must be EXPLICIT, EUC_2D, CEIL_2D, ATT, or GEO" check defined(x) "no NODE_COORD_SECTION" check size(x) == n "coordinates do not match DIMENSION" check x >= -1e9 && x <= 1e9 && y >= -1e9 && y <= 1e9 "coordinates must be between -1e9 and 1e9" }