where is the number of linear equation
constraints and is the number of flow variables.
Linear equality constraint vector is the vector of
given real numbers (right sides of the equations).
The length of the vector is .
The lower and upper bounds of flow variables
(items of ) are specified as real numbers - elements
of vectors , and . The vector satisfies the
inequality . The core of the solver for
the MILP solution in Matlab code is the command:
X=intlinprog(f,intcon,A,b,Aeq,beq,lb,ub),
(2)
where previously used variables are expressed by
the corresponding variable identifiers of Matlab
langu-age. The transformation of all variable labels
into Matlab identifiers is contained in Table 1.
A more detailed explanation of the intlinprog
command is available in [11].
3 Mathematical Formulation of the
Traveling Salesman Problem with
Time Windows
The traveling salesman problem with time windows
(TSPTW) can be defined as follows. Let
be a connected graph consisting of a set of
nodes indexed by , and a set of non-
negatively weighted arcs between pairs of
corresponding nodes of the graph . The index
is used for the seller, and indexes for
customers. For easier reference, let be
the set of customers, and . Each of the
customers can be reached only within a
specified time interval (window) . Vectors
of lower and upper boundaries of the time window
are denoted by and . For each customer
let be the service time associated with the
handover and unloading of goods. The vector of
customer service times means . The
constant means the moment when the vehicle can
first leave the depot.
Let be the length of the one-way path (in
meters) and the one-way time-distance (in
seconds), i.e. the travel duration from node to node
for all . Therefore is a
distance matrix and is a time-distance
matrix. Both matrices and are non-negative,
asymmetric, and related (but essentially independent
non-negative), with zeros on the main diagonal, i.e.
and for each . It is necessary to
satisfy the triangular inequalities among all nodes of
the graph in both matrices.
Since we have to respect time windows, it is
necessary that the time-distance matrix be used
for optimization. The elements of the time-distances
matrix are not strictly proportional, in general, to
the corresponding elements of the distance matrix
. The driving time between two nodes is
significantly influenced by the quality of the roads
used.
To start the optimization process, it is necessary
to select the time moment when the vehicle leaves
the depot. Regarding the lower valid time windows
of all customers, the appropriate time is:
(3)
But when the first visited customer is
selected during the optimization process, for which
it is valid that , then a waiting time
will be required. To eliminate the
unnecessary waiting time at the first customer, it is
appropriate to shift the departure time of the vehicle
from the depot to the real value .
The core of the TSPTW solution is to find the
cycle in the graph which contains all nodes of
the graph so that the travel time is the shortest, and
where all time windows are respected. For this
purpose, integer variables for are
introduced, which can only take the values 0 or 1.
The value means that the arc from the node
to is included in the cycle. The value
means that the corresponding arc is not included.
For a systemic reason, variables are included,
but all these variables are fixed by the value zero
(), for each . Variables are elements
of a matrix . The number of all
variables is .
Other flow variables that need to be used in the
TSPTW solution are the vehicle departure times
from all customers. Therefore real (non-integer)
flow variables are introduced for each . The
variable indicates the moment when the driver
leaves the customer number . The variables are
arranged as elements of a vector .
So, the number of all flow variables is .
The solution of TSPTW is realized by the
optimal solution of the mixed-integer linear
programming problem:
subject to (4)
are integers, even true that (5)
(6)
WSEAS TRANSACTIONS on INFORMATION SCIENCE and APPLICATIONS
DOI: 10.37394/23209.2024.21.18