Algorithm 4 — the elevated flow relaxation with matching and its matching probabilities
DefinitionSharedVehicleApprox_Pricing_Supplement_Algorithm4approximation-ratioclosed-queueing-networkp2o-batch-supp500p2o-gran-per-chapterp2o-plan-paperp2o-v1pricingshared-vehicle-systems
Algorithm 4 chooses quantiles and matching rates , with for , to solve
and outputs the matching probabilities . The definitions give feasibility, optimality and this output, which states Theorem 23.
Formalization Note The constraint is implicit on the page, as are rates. The balance and capacity constraints together give , so has row sums at most one and is zero where the denominator vanishes.
Definition code
import Mathlib
import Definitions.Def_QueueingFundamentals_Networks_ClosedJackson
import Definitions.Def_SharedVehicleApprox_Pricing_Model
namespace SharedVehicleApprox.Pricing.Supplement
open Finset QueueingFundamentals.Networks
/-- Feasibility in the relaxation of Algorithm 4 (p. 28): quantiles in `[0, 1]`, matching rates
`z ≥ 0` (rates, left implicit on the page) supported on `E`,
`∑_k (φ_ki q_ki + z_ik) = ∑_j (φ_ij q_ij + z_ji)` and `∑_k z_ki ≤ ∑_j φ_ji q_ji`. -/
def IsAlg4Feasible {n : ℕ} (φ : Fin n → Fin n → ℝ) (E : Finset (Fin n × Fin n))
(q z : Fin n → Fin n → ℝ) : Prop :=
(∀ i j, 0 ≤ q i j ∧ q i j ≤ 1) ∧ (∀ i j, 0 ≤ z i j) ∧ (∀ i j, (i, j) ∉ E → z i j = 0) ∧
(∀ i, ∑ k, (φ k i * q k i + z i k) = ∑ j, (φ i j * q i j + z j i)) ∧
∀ i, ∑ k, z k i ≤ ∑ j, φ j i * q j i
/-- `(q, z)` is an optimal solution of the relaxation of Algorithm 4: it maximizes
`∑_{i,j} φ_ij R_ij(q_ij)`. -/
def IsAlg4Optimal {n : ℕ} (φ : Fin n → Fin n → ℝ) (I : Fin n → Fin n → ℝ → ℝ)
(E : Finset (Fin n × Fin n)) (q z : Fin n → Fin n → ℝ) : Prop :=
IsAlg4Feasible φ E q z ∧
∀ q' z', IsAlg4Feasible φ E q' z' → elevObj φ I q' ≤ elevObj φ I q
/-- The matching probabilities `r_ij = z_ij / ∑_k φ_ik q_ik` output by Algorithm 4 (`0` when the
denominator is `0`). -/
noncomputable def matchProb {n : ℕ} (φ q z : Fin n → Fin n → ℝ) : Fin n → Fin n → ℝ :=
fun i j => z i j / ∑ k, φ i k * q i k
end SharedVehicleApprox.Pricing.Supplement
Source
Banerjee, Freund & Lykouris, Pricing and Optimization in Shared Vehicle Systems: An Approximation Framework, arXiv:1608.06819v4, p. 28 (PDF 29), Algorithm 4