reformulate_ATSP_as_TSP         package:TSP         R Documentation

_R_e_f_o_r_m_u_l_a_t_e _a _A_T_S_P _a_s _a _s_y_m_m_e_t_r_i_c _T_S_P

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

     A ATSP can be formulated as a symmetric TSP by doubling the number
     of cities (Jonker and Volgenant 1983). The solution of the TSP 
     also represents the solution of the original ATSP.

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

     reformulate_ATSP_as_TSP(x, infeasible = Inf, cheap = -Inf)

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

       x: an ATSP.

infeasible: value for infeasible connections.

   cheap: value for distance between a city and its corresponding 
          dummy city.

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

     To reformulate the ATSP as a TSP, for each city a dummy city (e.g,
     for 'New York' a dummy city 'New York*') is added. Between each
     city and its corresponding dummy city a negative or very small
     distance with value 'cheap' is used.  This makes sure that each
     cities always occurs in the solution together with its dummy city.
      The original distances are used between the cities and the dummy
     cities, where each city is responsible for the distance going to
     the city and the dummy city is responsible for the distance coming
     from the city. The distances between all cities and the distances
     between all dummy cities are set to 'infeasible', a very large
     value which makes the infeasible.

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

     a TSP object.

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

     Jonker, R. and Volgenant, T. (1983): Transforming asymmetric into
     symmetric traveling salesman problems, _Operations Research
     Letters, 2, 161-163._

_S_e_e _A_l_s_o:

     'ATSP', 'TSP'.

_E_x_a_m_p_l_e_s:

     data("USCA50")

     ## set the distances towards Austin to zero which makes it a ATSP
     austin <- which(labels(USCA50) == "Austin, TX")
     atsp <- as.ATSP(USCA50)
     atsp[, austin] <- 0

     ## reformulate as a TSP
     tsp <- reformulate_ATSP_as_TSP(atsp)
     labels(tsp)

     ## create tour (now you could use Concorde or LK)
     tour_atsp <- solve_TSP(tsp, method="nn")
     head(labels(tour_atsp), n = 10)

     ## filter out the dummy cities
     tour <- TOUR(tour_atsp[tour_atsp <= n_of_cities(atsp)])
     tour_length(atsp, tour)

