Matlog - Logistics Engineering Using Matlab PDF
Matlog - Logistics Engineering Using Matlab PDF
*
Corresponding author: [email protected]
15
M. G. Kay, Matlog: Logistics Engineering Using Matlab
16
Kay M. G., 2016. SDU-JESD-152932-15-20
M. G. Kay, Matlog: Logistics Engineering Using Matlab
avgdist =
304.7786
Both the initial p-Median and the ALA improvement
resulted in better average distance results than just
the single ALA run. Although multiple runs of ALA
would improve its results, they would still not likely be
better than p-Median with ALA improvement. The
reason that ALA is still valuable is the flexibility with
which the allocation and location subprocedures can
be defined. If the NFs are capacitated, then the
Figure 2. 4 NF Locations and Allocations to EFs
anonymous function allocate can be a call to trans, the
This average distance result of 307.2082 miles transportation problem procedure in Matlog; if some
represents only a single run. Since the ALA procedure the NF’s locations are fixed, then it is easy to modify
finds only a local optima, the procedure should be anonymous function locate.
applied multiple times using different initial NF
locations, keeping the best solution found as the final To understand the p-Median heuristic, see Daskin
solution. (1995); to understand how the heuristic has been
implemented in Matlog, the type command in Matlab
The Matlog function ALA implements the ALA can be used to list all of the code for pmedian. The
procedure and produces the same results. heuristic first adds 1 to p NFs using a greedy add
procedure ufladd, followed by the uflxchg pairwise
rng(1234) % using same seed as before exchange improvement procedure; this result is then
[NF,TC] = ala(randX(EF,p),pop',EF,'mi');
lonlat2city(NF,uscity)
compared to the result of the greedy drop procedure
ufldrop and uflxchg and the best result is reported.
NF 1 is 11.33 mi SE of Ponderosa, CA
NF 2 is 4.08 mi W of Lawrenceburg, KY
NF 3 is 4.00 mi W of Richardson, TX type pmedian
NF 4 is in Summit, NJ
17
Kay M. G., 2016. SDU-JESD-152932-15-20
M. G. Kay, Matlog: Logistics Engineering Using Matlab
[n,m] = size(C);
if nargin < 3 || isempty(dodisp), dodisp = true; end
subject to
n
∑ xij = 1
Table 1. Parameters
j = 1, ,m
Parameters Value
i =1 Tried aggregator 1 time.
yi ≥ xij i = 1, , n; j = 1, , m Presolve time 0.19 sec. (91.45 ticks)
Found incumbent of value 3.4020985e+011 after 0.33 sec.
n (169.65 ticks)
∑ yi = p Probing time
Tried aggregator
0.02 sec. (8.37 ticks)
1 time.
i =1
Presolve time 0.11 sec. (92.20 ticks)
0 ≤ xij ≤ 1 i = 1, , n; j = 1, , m Probing time 0.03 sec. (8.37 ticks)
yi ∈{0,1}
MIP emphasis: balance optimality and feasibility.
i = 1, , n MIP search method: dynamic search.
Parallel mode: deterministic, using up to 8 threads.
Root relaxation solution 21.84 sec. (7303.04 ticks)
where time
cij variable cost to serve all of EF j’s demand from site i
yi 1, if NF established at site i; 0, otherwise
xij fraction of EF j’s demand served from NF at site i.
This MILP for p-Median is termed a “strong
formulation” due to the second set of 𝑛𝑚 constraints,
which results in an LP relaxation that gives a tight
lower bound that quite often is optimal. When these
constraints are replaced with the n constraints
m
m yi ≥ ∑ xij
j =1 Figure 4. Result’s screen
,
i = 1, , n . The solution can then be displayed, where the Milp
method namesolution is used to extract the y variables
The formulation is termed “weak” since the lower
of the solution corresponding to the zero-valued
bound from the LP relaxation is not very tight,
coefficients c in the objective function.
resulting in a large branch-and-bound tree.
19
Kay M. G., 2016. SDU-JESD-152932-15-20
M. G. Kay, Matlog: Logistics Engineering Using Matlab
20
Kay M. G., 2016. SDU-JESD-152932-15-20