TSPLIB                  package:TSP                  R Documentation

_R_e_a_d _a_n_d _w_r_i_t_e _T_S_P_L_I_B _f_i_l_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Reads and writes TSPLIB format files. TSPLIB files can be used by
     most TSP solvers. Sample instances for the TSP in TSPLIB format
     are available  on the TSPLIB homepage (see references).

_U_s_a_g_e:

     write_TSPLIB(x, file, precision = 6, inf = NULL, neg_inf = NULL)
     read_TSPLIB(file, precision = 0)

_A_r_g_u_m_e_n_t_s:

       x: an object of class 'TSP' or 'ATSP'.

    file: file name or a 'connection'.  

precision: controls the number of decimal places used to represent
          distances (see details).  If 'x' already is 'integer', this
          argument is ignored and 'x' is used as is.

     inf: replacement value for 'Inf' (TSPLIB format cannot handle
          'Inf'). If 'inf' is 'NULL', the default value of 2 times the
          maximum value in 'x' (ignoring the infinity entries) is used.

 neg_inf: replacement value for '-Inf'.  If no value is specified, the
          default value of 2 times the smalles neg. number is used.  If
          'x' only contains positive values, -1 is used.

_D_e_t_a_i_l_s:

     In the TSPLIB format distances are represented by integer values.
     Therefore, if 'x' contains 'double' values (which is normal in R)
     the values given in 'x' are multiplied by 10^{precision} before
     coercion to 'integer'. Note that therefore all results produced by
     programs using the TSPLIB file as input need to be divided by
     10^{precision} (i.e., the decimal point has to be shifted
     'precision' placed to the left).

_V_a_l_u_e:

     'read_TSPLIB' returns an object of class 'TSP' or 'ATSP'.

_R_e_f_e_r_e_n_c_e_s:

     TSPLIB home page,  <URL:
     http://www.iwr.uni-heidelberg.de/groups/comopt/software/TSPLIB95/>

