1%% Example from Paper - Bounding Problem 1 (RS-
RD)
2% M=3 queues, F1=4, N=10, p=0.90 (balanced demands)
3% This
is the validation example from Section 7.1 of the TOMACS paper
4% All queues use K=2 phases to match the AMPL model structure
13params.M = 3; % Number of queues
14params.N = 10; % Total population (N >= F1+1
for blocking)
16% Queue capacities (F1=4 finite, others infinite=N)
17params.F = [4; 10; 10];
19% Number of phases per queue (K=2
for all to maintain consistency)
22% Routing probabilities with p=0.90 (balanced demands)
25 0.10, 0.50, 0.40; % from queue 1
26 p, 0.00, 1-p; % from queue 2
27 0.00, 0.50, 0.50 % from queue 3
30% Service rates mu{i}(k,h) - completion transition rates
31% Queue 1: MAP with D1 matrix (from paper Equation 7)
32% D1 = [1.016186165025678 0.000025857082896]
33% [0.001569887597955 0.014132983910493]
34params.mu = cell(3, 1);
36 1.016186165025678, 0.000025857082896;
37 0.001569887597955, 0.014132983910493
39% Queues 2,3: exponential with rate 1 (2-phase representation)
49% Background transition rates v{i}(k,h)
50% For MAP: v comes from D0 off-diagonal elements (=0 in this case)
52params.v{1} = zeros(2, 2);
53params.v{2} = zeros(2, 2);
54params.v{3} = zeros(2, 2);
56%% Solve
for utilization bounds at queue 1
57fprintf(
'====================================\n');
58fprintf(
'Paper Example: RS-RD Bounding Problem 1\n');
59fprintf(
'====================================\n');
60fprintf(
'Network: %d queues, %d jobs\n', params.M, params.N);
61fprintf(
'Finite capacity queue: 1 (capacity=%d)\n', params.F(1));
62fprintf(
'Routing parameter p = %.2f (balanced demands)\n', p);
63fprintf(
'Capacities: [%s]\n', num2str(params.F
'));
64fprintf('Phases: [%s]\n
', num2str(params.K'));
67fprintf(
'--- Minimizing Utilization at Queue 1 ---\n');
68[result_min, x_min, fval_min, exitflag_min] = qrf_rsrd(params, 1,
'min');
70fprintf(
'\n--- Maximizing Utilization at Queue 1 ---\n');
71[result_max, x_max, fval_max, exitflag_max] = qrf_rsrd(params, 1,
'max');
74fprintf(
'\n====================================\n');
76fprintf(
'====================================\n');
77fprintf(
'Utilization bounds for Queue 1:\n');
78fprintf(
' Lower bound: %.6f\n', fval_min);
79fprintf(
' Upper bound: %.6f\n', fval_max);
81fprintf(
'Reference from AMPL/GLPK:\n');
82fprintf(
' Lower bound: 0.733487 (expected)\n');
83fprintf(
'\nAll queue utilizations (at minimum):\n');
85 fprintf(
' Queue %d: U = %.6f\n', i, result_min.U(i));