![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
General linear-reduction (LR) bound on the utilization of one queue-phase of a closed MAP queueing network. More...
#include <cstddef>#include <string>#include <vector>#include "line/api/mapqn/mapqn_p1_common.h"#include "line/api/mapqn/mapqn_params.h"#include "line/num/number.h"#include "line/util/error.h"#include "line/util/matrix.h"#include "line/util/simplex.h"Go to the source code of this file.
Classes | |
| struct | line::mapqn::MapqnBndLrResult< T > |
| Result of a general LR bound solve. More... | |
Namespaces | |
| namespace | line |
| namespace | line::mapqn |
Typedefs | |
| using | line::mapqn::LrIndex = MapqnP1Index |
| Variable layout of the LR model: the shared p1-level blocks and nothing else. | |
Functions | |
| template<class T> | |
| MapqnBndLrResult< T > | line::mapqn::mapqn_bnd_lr (const MapqnParams< T > &p, int objective_queue, int objective_phase, MapqnSense sense=MapqnSense::Max) |
| Bound U(objective_queue, objective_phase) over the linear-reduction polytope. | |
General linear-reduction (LR) bound on the utilization of one queue-phase of a closed MAP queueing network.
Templated port of matlab/lib/qrf/mapqn_bnd_lr.m (ground truth), cross-checked against python/line_solver/api/mapqn/bnd_lr.py. Note the MATLAB file's own header records that it is a port OF the Python file, so the two are one lineage rather than two independent derivations; where they disagree, neither is automatically right and the AMPL model noblo_skel.mod settles it.
WHAT DISTINGUISHES IT FROM THE QUADRATIC REDUCTION. This model keeps only the singly-indexed p1(j,k,i,ni,h) and p1c, never the joint p2, so it is the cheaper relaxation: the column count is linear in (N+1) sum_i K(i) rather than quadratic. Fifteen of its twenty families are literally the quadratic model's, and live in mapqn_p1_common.h. The five that are its own replace what the p2 level would otherwise supply: MPCB sum_i C(j,k,i) = N U(j,k), the aggregate of the QR model's THM2 UJNT AMPL SIMMETRY projected onto p1, standing in for PI23 GFFL0 AMPL THM30 on p1, the empty-station level crossing GFFL AMPL THM3 on p1, the level crossing between n_i and n_i + 1 QBAL throughput balance at each station
THE FAILURE MODE OF THIS FAMILY IS A VACUOUS BOUND, NOT A CRASH. GFFL and GFFL0 are the only families that read the rates into the p1 variables, and SRVB the only one that reads them into U. Drop them and no constraint distinguishes a fast station from a slow one, so U = 0 stays feasible and the routine returns the [0,1] box with every subscript internally consistent. That is exactly the 2026-07-20 defect in mapqn_bnd_lr.m, which built q and then referenced it in NO constraint at all. Each family is therefore emitted by a function named after it; do not inline them.
ORACLE. At K(i) == 1 for every i the phase structure disappears and this model must reproduce mapqn_bnd_lr_pf exactly, on the same instance and in the same sense. That is the check test_mapqn_bnd_lr.cpp leads with, and it is what the MATLAB reference itself uses (it holds there to 1e-7).
ARITHMETIC. Assembly is +, -, * on the model data and lp::simplex_solve uses Bland's rule with no tolerance, so at T = line::Rational the returned bound is the EXACT optimum of the exact polytope. MATLAB reaches it with linprog's 'interior-point' and lands a few digits short.
Definition in file mapqn_bnd_lr.h.