Discrete Applied Mathematics 14 (1986) 231-238
North-Holland
231
R E C O G N I T I O N OF G I L M O R E - G O M O R Y T R A V E L I N G
S A L E S M A N PROBLEM
R. C H A N D R A S E K A R A N
The University o f Texas at Dallas', Box 688, Richardson, T X 75080, USA
Received 17 June 1985
Revised 2 August 1985
The best known special case of the traveling salesman problem that is well solved is that due
to Gilmore and Gomory. It is a problem of scheduling a heat treatment furnace. In this paper
we give a polynomial algorithm for detecting whether or not a given traveling salesman problem
is an instance of their problem; we also compute the parameters necessary to apply their
algorithm. Thus all such problems can not only be solved in polynomial time but also recognized
in polynomial time.
Perhaps the best known special case of the traveling salesman problem that is also
well solved is due to P.C. Gilmore and R. G o m o r y [1]. This problem arises in the
context of scheduling a heat treatment furnace. Given are numbers Ai, i =
1, 2..... n; Bi, i= 1, 2 ..... n; and functions f and g satisfying (f+g)>_O. The
'distances' dij a r e defined by the relations:
' |j
tBf(x)&v
ifAi>_Bi,
t'~' g(x)dx
if Bi>_Aj.
, Aj
For such a traveling salesman problem Gilmore and G o m o r y gave an efficient
algorithm. They first solve the corresponding assignment problem by a simple sorting of 'cities' according to their A i and B i values. If the resulting solution is a tour,
then it is the required optimal solution. If not, by solving a minimal spanning tree
problem on a reduced graph they were able to identify the pairs of subtours that
were to be hooked up; finally by doing the hooking up in a particular order they
were able to show that the resulting tour is the optimal one.
In this paper we determine whether or not a given traveling salesman problem is
equivalent to one of the G i l m o r e - G o m o r y type. The input in G i l m o r e - G o m o r y
paper are the numbers Ai, Bi and the functions f and g. The input here are the d 0 .
When our problem is equivalent to one of theirs we produce a set of A i , B i and
functions f and g which in turn can be used in their algorithm to solve the problem.
Since our recognition algorithm is also polynomial the entire method is efficient.
0166-218X/86,$3.50
: 1986, Elsevier Science Publishers B.V. (North-Holland)
R. Chundrasekaran
232
The paper is in three parts: first we study properties of Gilmore-Gomory problems to get a better understanding of the nature of these problems. Then we use
this information to determine whether or not a given traveling salesman problem is
one of this type. In the final section we define a notion of equivalence among traveling salesmen problems and show that under this notion, traveling salesman problems equivalent to one of Gilmore-Gomory type are themselves of this type.
Familiarity with the paper by Gilmore and G o m o r y is assumed.
Properties of Gilmore-Gomory problems
The most important fact regarding the algorithm in [1], is that the realization of
their algorithm remains unchanged as long as ( f + g ) , and the intervals
(Aj, A 1 ) A ( B i , Bx) remain the same. Under these circumstances the algorithm
selects the same assignment, the spanning tree selected is the same as is the order
of connecting the subtours. Thus the solution is also the same. We will show that
problems of this type are equivalent in our sense in the last section.
Lemma 1. Given a Gilmore-Gomory problem with A i, B i and functions f and g
the following relation holds (see [1]):
Idij + d k l -
di/-
dkjl = t' ( f ( x )
+ g(x)) dx
where the integral is" carried over the interval (A j, A I) 0 (Bi, Bk).
Suppose we can partition {1 ..... n} in two ways into sets Tj, T1,...,T,, and
S~..... Sin- ~ such that
i t Tk, j ~ S I , l<<_k =
Bj>--A i,
itTk, j~Sl, l>k
Bj>Ai.
~
Also let IT~I =r, and IS~l =s~. [If the smallest of A ' s and B's is Bi, then slight
modifications are necessary; but these are easily done.] If we arrange the matrix D
so that the columns correspond to increasing order of Ai and rows to an increasing
order of B i, the matrix D looks like that in Fig. 1.
b'-a'=c'-d'=
,t f ( x ) d x
Ak
and
'/I m
b - a =c - d =
t
g(x) dx.
JAI
If we denote the entries of this permuted by Dtil, iJ 1, then we can show the
following.
Recognition of Gihnore-Gomory traveling salesman problem
-r I-
r 2 ----D
r4 ~
T2
T4 ~
r5
T
•T6 ,
L
5
I
A
233
r
I
sI
SI
Z+
SEPARATING
LINE
÷
s4
S4
s5
S5
a 1
c
1_
i
I
T
t
,
I
Am
An
FI
Fig. I.
(1) For [i]_<[jl, [kl-<[l]
A([i][jl)([k][l]) = D[jl[k] + D[i][ll - D [ i ] H - D[j][/] >- O.
S u c h a m a t r i x is said to have the M o n g e property. I n d e e d , a stronger f o r m o f this
p r o p e r t y is true here:
Jill -< [i2], [JJ] -< [J2], [k]] >_ [k2], [6] >- [12]
=:>
A([id, [JlI)([/q][/[])>-- A([i2], [j_,]), ([kz], [12])"
All o f this f o l l o w s f r o m L e m m a 1 and the a s s u m p t i o n
(2) F r o m the a b o v e , it f o l l o w s that if
D . [i] = D . [j] + c~e
f+g>_O.
w h e r e e = (1, l . . . . . 1)( for s o m e scalar c~,
then the s a m e is true for i', j ' w h e r e [i']_> [i], [ j ' ] _ < [ j ] .
R. C h a n d r a s e k a r a n
234
This is because, if we form A ' s by taking elements f r o m these columns, they will
all be equal to zero. Thus, such columns are consecutive in this ordering.
(3) If we let
__ i'A[i+I1
U~
g(x) dx,
Vi =
--JA[d
t'AI/I
f(x) dx,
,,A[i II
Un=O=VI,
and
hi= I
g(x) dx,
i6 Sk,
,] Bid
'Bid
ai =
t
f(x) dx,
i e Sx ,
J A [r~I
then all the elements o f the matrix can be written in terms o f these as follows.
~}, J
P
D[il[jl=a i - ~ Uk
for i ~ S p , j e
k=j
U TI, J:/:Ak,.I,
/
I
i
=bi+
~
Vk
for i E S p , j ~
k=rv+ I
U
TI, j:/:A[,,,~ 11.
I=p+ l
For j = rp, i~S~,,
Diil, bl=a i .
F o r j = r v+ l, ieSp,
Dii],H=bi.
Recognition of Gilmore-Gomory type matrices
N o w we are ready to describe the m e t h o d for recognizing whether or not a given
distance matrix D is o f G i l m o r e - G o m o r y type and to produce A i, B i and f and g
if it is. It consists o f several steps.
Step 1. Define an equivalence relation between the columns o f D as follows:
D . i = D . j if D.i-O.j=o~e where c~ is some scalar and e = ( 1 , 1. . . . . 1)~. The
equivalence classes correspond to consecutive columns in the arrangement we have
discussed so far.
Step 2. If two columns j and l are in different equivalence classes, there is a pair
(i, k) such that A(i,j)(k,l):PO. Using this we can order these two columns so that if
[j] < [l], then A(i,j)(k,i)>O. Then all such A ' s using these two columns will also be
nonnegative unless the given matrix is not one o f the G i l m o r e - G o m o r y type). This
process uniquely orders the equivalence classes if the given matrix is o f the right
type. We can order rows in a similar fashion. We note that the resulting matrix will
235
Rt.cognition o/Gilmore -Gomoo' traveling sah'wnan problem
have the strong Monge property. Note that columns (or rows) in the same
equivalence class need to go as a b l o c k , but the o r d e r is i m m a t e r i a l .
S t e p 3. In this p a r t we d e t e r m i n e q , r2, . . . , r m a n d S¿, . . . , S m 1- rl = t h e size o f the
equivalence class c o n t a i n i n g D . [~1" S~ is o b t a i n e d as follows: if we ignore the first
r 1 c o l u m n s o f this o r d e r e d m a t r i x , the n u m b e r o f rows in the r e m a i n i n g m a t r i x
' e q u i v a l e n t ' to first row (in the r e m a i n i n g m a t r i x ) is s I . C o n t i n u a t i o n o f this argum e n t yields the r e m a i n i n g n u m b e r s . W e note t h a t this p r o d u c e s the ' s e p a r a t i n g ' line,
a n d the m a t r i x must now be g e n e r a t e d by the f o u r sets o f n u m b e r s a , , b,, /5,. a n d
Vi.
S t e p 4. N o w we p r o d u c e A i, B i a n d f a n d g. First we note that the elements on
either side o f the ' s e p a r a t i n g line' are the a i and b i . K n o w i n g a,,, b i we can define
Ui, V, as follows:
V i = D[,q[i+ 11-- D[nl[i],
l<_i<_k
where an=Dlnl[#~ Jl;
II,
Vj=D[ti[jl-DIlllJ
q<_j<_n
where DIll[ q ll = b l .
G i v e n the ' s e p a i a t i n g line' we k n o w the sets T I, T2. . . . . T,, a n d S I . . . . . S,,, i. It is
easy to give the values 1. . . . . 2n for A i a n d Bi such that the first [TiI values are given
to A ' s c o r r e s p o n d i n g to c o l u m n s in T 1, the next ISil values are given to Bi's in Sj
a n d so on. N o w we d e f i n e f a n d g as follows: first for an interval [ALj U, A[jl]
f(x) AuI-A[j
l]
whenever A t j _ I] * A { ~ I ,
Ui
g(x)
,"t [i+ 11- A l l ]
whenever All I :¢:Alr,. 1 .
N o w for intervals o f the type
[A[~I, B[id, B[io + l], ..., B[io+&l, A[~,+ 1]]
/, i
where io = ~ S t + 1.
l-O
For xe[B[i
O, Ctio 1 = 0 ) :
II, B[il],
f(x) -
b i - bi j
/5[il -- eli
g(x) =
y kt=0I S r + I < -i < - ~ tk= l St
11
ai -- a i - 1
i3[i]-B[i
I] "
(with
B[i d
l = A[r~l, bio I =
236
R. Chandrasekaran
For x ~ [B[i.+ s~l, A[r~ + Jl]:
f(x) =
g(x) =
r~ - - bi,, + Sk
Ar~ + 1 - B[i~+ s~] '
U
Vr~+ l - a[io+ s~l
A[r*+ d - B[i~+s*] "
f=g=0
for x ¢ [ l , 2n].
The Monge property implies f + g _ 0 . If any of these steps cannot be done, the
matrix is not of G i l m o r e - G o m o r y type. If Dij cannot be produced with these Ai,
Bi, f and g, the matrix is not of G i l m o r e - G o m o r y type.
Equivalence between traveling salesman problems
In this section we propose a notion of equivalence for traveling salesman problems and study conditions that are necessary and sufficient for such an equivalence
to hold.
Definition 1. Given two traveling salesman problems with distance matrices D and
D ' we say that they are equivalent if the difference in the total distance using the
two matrices is independent of the tour.
Definition 2. Given two assignment problems with cost matrices D and D ' we say
that they are equivalent if the difference in total cost using the two matrices is independent of the assignment.
Definition 3. Given two linear programs that differ only in the objective vector we
say that they are equivalent if the difference in the objective function is independent
of the feasible solution.
Theorem 1. C o n s i d e r t w o linear p r o g r a m s :
(1) m i n c x : A x = b ,
x_0;
(2) m i n c ' x : A x = b , x > _ O .
T h e s e t w o linear p r o g r a m s are e q u i v a l e n t in the s e n s e a b o v e i f f there is s o m e u
s u c h that ( c - c') = u A .
Corollary 1. T w o a s s i g n m e n t p r o b l e m s o f the s a m e size are e q u i v a l e n t i f f there ex&ts
a set o f n u m b e r s u i a n d Vy s u c h that
t
dij - d,j = ui + uj
f o r all i a n d j .
The main purpose of this section is to provide a similar result for the traveling
salesman problem.
Recognition qf Gihnore-Gomory traveling salesman problem
237
L e m m a 1. Two T S P with distance matrices D and D' are equivalent i f f the T S P with
distance matrix D" = D - D' has a constant length f o r all tours.
L e m m a 2. I f f o r a T S P with distance matrix D" the length of a l l tours is a constant
and the size o f the problem is f o u r or larger, then the following relation holds f o r
all sets o f f o u r distinct indices i, j, k, l:
(*)
d~+d~'z=dj+d~'.j
A n d conversely if the above relation holds, then all tours have a constant length.
P r o o f . If all tours have the same length the following hold:
(I)
d/'k+d~',+d;j'=d~'+dTk+d~'.j,
(II)
dgj + djl + dtk = dgI + dlj + djk,
(III)
dfk + d~:t+ d~'--dj; + dl~ + d~:i,
(IV)
d/k + dki + dij = dli + dik + dkj.
tt
tt
t!
tp
tt
tt
t!
tt
tt
tt
tt
#
Adding (I), (ll) and (III) and subtracting (IV), dividing the result by 2 and rearranging terms gives (*). Since (,) implies the equations (I)-(IV), we can transform any
tour into any other by pairwise interchange and since the total distance remains constant throughout this process, the converse follows.
T h e o r e m 2. Under the hypothesis o f L e m m a 2, every assignment in which the
variables xii :-0 f o r all i has the same cost as a tour (and hence all tours). This in
turn implies that all such assignments have the same cost under this hypothesis.
P r o o f . Since xii= 0 for all i, all subtours in any feasible solution to the assignment
problem have at least two arcs. Now we show that these subtours can be combined
into a tour without changing the total cost. See Fig. 2. Since dgj + dkz = dg~+ dkj, we
can delete the arcs (i, j ) and (k, l) and instead introduce arcs (i, l) and (k, j ) without
tt
\
Fig. 2.
it
vt
tt
238
R. Chandrasekaran
altering the total cost. C o n t i n u i n g this process eliminates all s u b t o u r s in the given
a s s i g n m e n t a n d p r o d u c e s a t o u r o f the same cost as the original a s s i g n m e n t . Hence
the result.
R e m a r k . O n e can use the same t y p e o f a r g u m e n t to show that thc vectors c o r r e s p o n ding to all a s s i g n m e n t s with xii = 0 for all i can be s p a n n e d by the vectors corr e s p o n d i n g to traveling s a l e s m a n tours. A l s o , C o r o l l a r y 1 is still valid if we restrict
o u r a t t e n t i o n to a s s i g n m e n t s in which xii= 0 for all i. T h u s we have the following
theorem:
Theorem
3.
Two
traveling s a l e s m a n p r o b l e m s
D and D'
are e q u i v a l e n t
if./
d~ = d~i - di~ = u i + vj f o r s o m e set o f n u m b e r s u i a n d vj.
T h u s the equivalence can be c h e c k e d in p o l y n o m i a l time. Fiscally we note t h a t if
we started with a traveling s a l e s m a n p r o b l e m o f G i l m o r e - - G o m o r y type a n d
t r a n s f o r m the p r o b l e m b y a d d i n g c o n s t a n t s to each row a n d c o l u m n , then we do
not c h a n g e the structure o f the m a t r i x a n d hence p r o b l e m s t h a t are equivalent to
a G i l m o r e - G o m o r y t y p e traveling s a l e s m a n p r o b l e m are themselves o f that type.
Thus, these a l g o r i t h m s ' scope c a n n o t be extended by simple a r g u m e n t s like that of
equivalence as d e f i n e d here.
Reference
[1] P.C. Gilmore and R.E. Gomory, Sequencing a one-state variable machine: A solvable case of the
traveling salesman problem, Oper. Res. (1964) 11, 655-679.
© Copyright 2026 Paperzz