Fluid and diffusion approximations of probabilistic matching systems

This paper focuses on probabilistic matching systems where two classes of users arrive at the system to match with users from the other class. The users are selective and the matchings occur probabilistically. Recently, Markov chain models were proposed to analyze these systems; however, an exact analysis of these models to completely characterize the performance is not possible due to the probabilistic matching structure. In this work, we propose approximation methods based on fluid and diffusion limits using different scalings. We analyze the basic properties of these approximations and show that some performance measures are insensitive to the matching probability, agreeing with the existing results. We also perform numerical experiments with our approximations to gain insight into probabilistic matching systems.


Introduction
The Internet has provided society a new medium to carry out business and personal transactions.In this work, our goal is to provide tractable methods to analyze probabilistic matching systems introduced in Büke and Chen [3] to study the web portals that serve as a meeting point for suppliers and customers of a specific product or service.The examples of such systems include employment and rental portals, matrimonial and dating Web sites and general purpose classified advertisement Web sites.
The users of a probabilistic matching system can be classified into two groups as customers (for example, employers) and suppliers (for example, employees).Customers arrive at the system according to a stochastic process.When a customer arrives at the system, she searches the list of suppliers to see whether there is anybody selling the product (or the service) she demands.If she finds suppliers with suitable products, she buys a product, choosing one uniformly at random, and both the customer and the supplier leave the system together.If there are no suitable products available, then she posts an advertisement on the system indicating her demand and waits until a supplier with a suitable product arrives at the system.The suppliers also exhibit a similar behavior.
The double-ended queue introduced in Kashyap [12] is a precursor for the matching system and considers the queueing process of taxis and customers at a taxi stop.Taxis and customers arrive at the stop according to independent Poisson processes and if a taxi (customer) arrives when there are no customers (taxis) waiting at the stop, she waits until a customer (taxi) arrives.Recently, there has been a growing interest to study matching systems which can be perceived as generalizations of double-ended queues.For these systems, each class of users has several subclasses, which we refer to as types, and these types determine whether users from different classes can match or not.Drawing an analogy between these matching systems and the taxi problem of Kashyap [12], in these systems there are different types of taxis, each of which serves a set of neighborhoods, and a taxi accepts a customer, in other words matches with the customer, if and only if she is going to a neighborhood served by the type that the taxi belongs to.For these models, once the types of users are known, the matchings occur deterministically and the main goal is to devise policies to decide on which users should be matched with each other.Caldentey et al. [5] introduce a matching system with two classes of users, namely customers and servers, where each class has several types.The types of servers with which a customer of a given type can match are determined using a bipartite graph.The model can be thought of as a discrete-time process where exactly one customer and one server arrive at each time period.The types of the arriving customer and server are independent and follow a given probability measure.If there are users who can match after arrivals occur, they are matched on a first-come-first-served basis.The authors conjecture necessary and sufficient conditions on the probability measure for the stability of these systems, and they prove that if a given system is stable the matching rates of different types converge to a limit.They also study stability of some simple systems.Adan and Weiss [1] prove that the conditions conjectured in [5] are necessary and sufficient and they prove that the stationary probabilities have a product form.Bušić et al. [4] generalize this model by dropping the independence of arriving types.They consider matching policies other than first-come-first-served.Using the fact that the conditions conjectured in [5] are necessary for stability, they show that matching the longest queue has a maximal stability region, i.e., the system is stable for any probability measure that satisfies the necessary conditions.They also show that matching the shortest and some priority policies does not have a maximal stability region and prove some sufficient conditions for the stability of these matching systems.Mairesse and Moyal [15] generalize the bipartite matching model and develop necessary conditions for matching networks with general topology.
In a recent work, Gurvich and Ward [10] study a system where the matchings do not need to be pairwise, but more than two users can match based on their classes.The arrivals to each class occur according to a continuous-time stochastic process, and the system controller decides who will match with whom.Gurvich and Ward [10] consider the objective of minimizing the finite horizon inventory holding cost and suggest a periodic review policy which relies on solving a linear program.They show that as arrival rates increase to infinity, the suggested periodic review policy is asymptotically optimal.
The key feature which differentiates probabilistic matching systems from the conventional matching systems in the literature is the probabilistic nature of the matching process.When a customer arrives at the system, she checks the products of all the suppliers and may find each product suitable with a given probability independent of the others.Hence, with positive probability she may not find any suitable product, even if there are several suppliers offering a product in the system.To make this argument more concrete, consider an employment portal as an example.An employer arriving at the employment portal first scans through the resumés of all the employees in the system, and she may hire each potential employee with a given probability.There is a positive probability that she may not find any of the existing candidates suitable, in which case she posts a job advert and waits in the system until a suitable candidate arrives.Hence, unlike the double-ended queues, users from different classes can coexist in the system when the matchings are probabilistic, which makes it essential to model the queueing system as a two-dimensional stochastic process.Büke and Chen [3] study the effects of the matching probability on the performance of these systems using an exact analysis and show that if uncontrolled these systems are unstable.Büke and Chen [3] also suggest stabilizing admission control policies to decide when to accept an arriving user into the system based on the system size and analyze some performance measures (for example, throughput and average queue length) under the suggested policies.
As indicated by the employment portal example, probabilistic matching systems are especially useful when the operator does not have any control over the matching behavior.For example, in an employment portal, employers have the full list of employees and can decide to hire one of the candidates irrespective of their queueing behavior, for example, the operator cannot force an employer to hire employees based on the their arrival time.Dating and matrimonial Web sites, rental or auto trade portals are examples of other systems where the matching cannot be controlled by the operator.The probabilistic matching behavior complicates the analysis of these systems and renders a complete exact analysis intractable.Hence, in this work we propose approximation methods based on fluid and diffusion limits under two different scalings.Under our first scaling, we only scale time and space and keep the matching probability constant to obtain the limiting processes.We show that under this scaling both fluid and diffusion limits do not depend on the matching probability, which implies that the users from at most one class accumulate in the system and the probability of a user finding a match upon arrival approaches either zero or one.
In many applications, it is crucial to study the effect of the matching probability on the system performance.To provide tools which address the matching probability explicitly, we propose a second scaling that also handles the abandonment of impatient users and scales the matching probability and the abandonment rate along with the time and space.The resulting fluid and diffusion limits under this scaling involve differential equations which are not tractable analytically in the general case, although we can derive an analytical formula for the fluid limit when there are no abandonments.Büke and Chen [3] show that some performance measures, such as the difference between the average queue lengths of different classes, are insensitive to the matching probability under certain control policies.Despite not imposing any control policy, similar to the results in [3] we show that the difference between queue lengths for different classes is also insensitive to the matching probability in the fluid limit.
In addition, we analyze the asymptotic behavior of the fluid limits.We first compare the fluid limits under both scalings, i.e., limits with and without scaling the matching probability, and show that when the abandonment rate is zero, the fluid limits in both scaling regimes agree with each other as time goes to infinity.Further, we show that for nonzero abandonment rates, the fluid limits converge to a unique fixed point, which is representative of the long-run average number of users in the system.We prove that as the abandonment rate increases, the fixed point component for the class with lower arrival rate first experiences an increase and then decrease, while for the class with higher arrival rate it decreases monotonically.Finally, we present numerical results to understand the approximation quality of probabilistic matching systems by the fluid limits.We also analyze the properties of fluid and diffusion limits in the second scaling regime using numerical methods.
There exists an extensive literature on fluid and diffusion approximations for Markovian systems with abandonments.Ward and Glynn [18] suggest diffusion approximations for the M/M/1 queue with exponential abandonments.They generalize these results to arrival, service and abandonment times with general distributions in [19].Garnett et al. [9] consider the M/M/N queue with exponential abandonments and suggest diffusion approximations under the Halfin-Whitt regime (see Halfin and Whitt [11]).Generalizing these results, Dai and He [7] and Mandelbaum and Momčilović [16] suggest diffusion approximations for many-server queues with general arrival, service and abandonment times.A recent work by Liu et al. [14] suggests diffusion approximations for the double-ended queue where arrivals are renewal processes and customers abandon the system if they cannot find a match after an exponential time.This paper is closest to our work in nature and the scaling they consider has similarities with both scalings presented here.In [14], the matching probability is not considered explicitly and is fixed to one, which is similar to the scaling we present in Sect.3, whereas the abandonment rate is scaled to go to zero, similarly to our second scaling in Sect. 4.Even though we restrict ourselves to Poisson arrival processes, our work extends [14] by assuming probabilistic matching structure.

Notation
We assume that all stochastic processes used in this paper are defined on the probability space (Ω, F, P).The sample paths of the stochastic processes are assumed to take values in D[0, ∞), i.e., the space of right continuous functions with left limits.X (ω, t) denotes the value of stochastic process X at time t for sample point ω.We suppress the ω in the notation if we do not need to refer to the sample point explicitly.In this work, our goal is to develop approximations for probabilistic matching systems using convergence of probability measures.We use a.s.−→, P −→ and ⇒ to denote almost sure convergence, convergence in probability and convergence in measure, respectively.We also occasionally need to use the indicator function I ρ which takes the value 1 if the proposition ρ is true and 0 otherwise.We use N and R ≥0 to denote the sets of nonnegative integers and nonnegative real numbers, respectively.

The probabilistic matching model
In this work, we study probabilistic matching systems introduced in Büke and Chen [3], where two classes of users, indexed by i = 1, 2, arrive at the system to be matched with users of the other class.We assume that class-i users arrive according to a Poisson process with rate λ i .Any given pair of class-1 and class-2 users can match with each other with probability q independent of other users.Let X i (t) be the number of class-i users in the system at time t.When a class-1 user arrives at time t, she checks the class-2 queue to see whether there exist any suitable users that she can match with.If she can find one or more suitable class-2 users to match with, she chooses one of them uniformly at random and they leave the system together.Otherwise, she joins the class-1 queue and waits in the system until she is picked by an arriving class-2 user.Due to the independence of matchings, a class-1 user finds a suitable class-2 user to match upon arrival with probability 1 − (1 − q) X 2 (t) and is not able to match with anyone with probability (1 − q) X 2 (t) .The same rules also apply when class-2 users arrive.For the analysis in Sect.4, we also assume that the users are impatient and each user abandons the system without being matched after waiting an exponential time with rate γ ≥ 0. For notational convenience, in the remainder of this paper we also assume that the system under consideration is initially empty, i.e., (X 1 (0), X 2 (0)) = (0, 0) with probability one.
Under the assumption of Poisson arrivals, the number of users in a probabilistic matching system, {(X 1 (t), X 2 (t)), t ≥ 0}, can be modeled as a continuous-time Markov chain (CTMC) on a probability space (Ω, F, P) with the generator matrix The above model reduces to the one introduced in [3] if users do not abandon the system (γ = 0).It is sometimes useful in our analysis to express the queue length processes, X i (t), as the difference of counting processes.We define A i (t) and R i (t) to be the number of arrivals and the number of user abandonments from class-i up to time t, respectively.Similarly, defining M(t) to be the number of matched pairs up to time t, we have the basic relation The essential element distinguishing a probabilistic matching system from a conventional queuing system is the matching probability q.To see this, consider a probabilistic matching system with no abandonments (γ = 0).For systems with matching probability q = 1, class-1 and class-2 users cannot coexist in the system at any time.Hence, the probabilistic matching system can be modeled as a continuous-time random walk on the integers {X (t), t ≥ 0}, where Also when q = 1, the number of matched pairs up to time t is equal to the minimum of class-1 and class-2 arrivals.Hence, However, when 0 < q < 1, analyzing the matching process M(t) is far more difficult.The one-dimensional distribution of the matching process, P(M(t) = k) for a given t ≥ 0 and k ∈ N is provided in [3], and its complicated nature indicates the difficulty in fully characterizing the law of the matching process.Hence, in this paper we propose fluid and diffusion approximations for probabilistic matching systems.

Fluid and diffusion approximations with constant matching probability
In this section, we focus on fluid and diffusion approximations for probabilistic matching systems obtained by only scaling time (or equivalently the arrival rates) and space while keeping the matching probability constant.For scalings with a constant matching probability, we assume that the users do not abandon the system without being matched, i.e., γ = 0.Both fluid and diffusion limits under this scaling fail to represent the matching probability explicitly, indicating the need to scale the matching probability as studied in Sect. 4.

Fluid limits
We start by defining the scaled process {( X n 1 (t), X n 2 (t)), t ≥ 0} as We derive the limiting process of { X n i (t), t ≥ 0} as n → ∞.For any ω ∈ Ω, we say that A direct application of the functional strong law of large numbers (see, for example, [2,6,20]) to Poisson arrival processes yields As users of a class accumulate in the system, the users of the other class are more likely to match upon their arrival.This implies that class-1 and class-2 users are unlikely to accumulate in the system at the same time.Lemma 1 formalizes this argument.

Lemma 1 For any fixed k
Proof If q = 1, since class-1 and class-2 do not coexist in the system, for any t ≥ 0, min{X n 1 (t), X n 2 (t)} = 0, and hence the desired conclusion follows trivially.If 0 < q < 1, to simplify the notation, define Choosing a ∈ (0, k) and N ≥ 2 such that N −a < , we have We will now prove that the right-hand side of (2) converges.We take λ = λ 1 + λ 2 , and for any m ∈ N, we have We see that the inequality in (3) holds using the following argument.For both X 1 (nt) and X 2 (nt) to reach a level above n k−a at some point during [ m n 2 , m+1 n 2 ], at least one of the arrivals occurring during [ m n 2 , m+1 n 2 ] should fail to match and stay in the system upon arrival when facing at least n k−a users from the other user queue (where x is the smallest integer no smaller then x).If we observe j arrivals during this time interval, the probability of this event is bounded by j (1 − q) n k−a .Then, for any fixed T > 0, Hence, using (3), we conclude Using simple calculus, we can show that there exists an N a such that for all n > N a we have Hence, the left-hand side of (2) converges and the result follows.
Theorem 2 X n i a.s.
−→ Xi u.o.c. as n → ∞, where Proof Equation ( 1) and Lemma 1 imply that there exists a Ω ⊂ Ω with P(Ω ) = 1 where, for every ω ∈ Ω , min Our first goal is to show Without loss of generality, assume λ 1 ≥ λ 2 and suppose that there exists an ω ∈ Ω for which (7) does not hold, i.e., we can find T > 0, δ > 0 and a sequence n j such that Using (5) and the fact that M(ω , t) ≤ min{A 1 (ω , t), A 2 (ω , t)} for all t ≥ 0, this implies that there exists a sequence t j such that 0 ≤ t j ≤ T and Boundedness of t j and M(ω , 0) = 0 also imply that there exists a convergent subsequence t j k → t > 0. For any > 0, we can choose N such that for every k > N we have 123 Similarly, we also get which contradicts Lemma 1 and proves ( 7).This implies for i = 1, 2 and every ω ∈ Ω , which concludes the proof.
The fluid limit (4) does not depend on the matching probability q.This indicates that the users with the lower arrival rate do not accumulate in the system and the system behaves similar to the taxi problem studied in Kashyap [12].

Diffusion limits
Fluid limits provide useful approximations to determine how queue lengths grow; however, they fail to represent the stochastic fluctuations.To understand the fluctuations of sample paths around the fluid limit, we now focus on diffusion approximations.A direct application of the functional central limit theorem (see, for example, Theorem 5.7 in [6]) on Poisson arrival streams gives where Âi = √ λ i B i , and B i (t), i = 1, 2, are independent one-dimensional standard Brownian motions.We define the process Now we are ready to state the diffusion limits for probabilistic matching systems when the matching probability is kept constant.
where Xi is defined as: Proof We first consider the case when λ 1 = λ 2 = λ.Define Mn (t) := M(nt)−λnt √ n .Using the Skorohod representation theorem (Theorem 5.1 in [6]), there exist versions of A i (t), Âi (t) and B i (t), i = 1, 2, which we denote a.s.−→ 0 u.o.c.Proceeding in the same manner as in the proof of Theorem 2, we get M•n a.s.
. Applying the continuous mapping theorem (Theorem 5.2 in [6]), the result follows for λ 1 = λ 2 = λ. When ≥ n} and define a sequence of random variables {ξ n } n≥1 such that if the nth arriving user-2 successfully finds a match upon arrival, 0, otherwise.
We have τ n → ∞ a.s. as n → ∞, and for any n ≥ 1, Consider a sequence of independent uniform(0,1) random variables {U n } n≥1 .Assuming 0 0 = 1, we have Next we show that there exist an N > 0 and c > 0 such that for any n ≥ N , a.s.Since τ n → ∞, there exists an N > 0 such that for any n ≥ N , we have τ n > T and Using the Borel-Cantelli lemma, P(ξ n = 0 infinitely often) = 0, which in turn implies Finally, we have Hence, the result follows from the continuous mapping theorem.
We conclude that when the matching probability q is kept as a constant in the scaling, it is absent in both the fluid limits and the diffusion limits.Moreover, we can compare our results with those for an M/M/1 queue.When the arrival rates in probabilistic matching systems are not equal, the fluid and diffusion limits of the queue length process i behave in accordance with that in an M/M/1 queue with arrival rate λ i and service rate λ j (see Chen and Yao [6] for more details).When the arrival rates are identical, the diffusion limits are distinct from those of an M/M/1 queue, due to the fact that in a probabilistic matching system the next arriving user i is possibly matched immediately upon arrival, which indicates that the accumulation of user j when no user i is present would not be a "waste," unlike the service time generated in an empty M/M/1 queue.As a result, rather than having the one-sided regular function of the net-input process, we only have the positive sign of the difference between the arrival processes.We suggest that this diffusion approximation would fit a system which has a relatively high matching probability for each pair of users and thus the probability of an arriving user getting matched increases significantly as the number of users from the other queue grows.However, the underlying assumption above does not hold in those systems which have a very small matching probability for each pair of users, because if q very close to 0, a user is not so likely to find a match upon arrival even when there are many users in the other queue.

Fluid and diffusion limits for systems with small matching probability
The matching probability disappears in the fluid and diffusion limits presented in Sect.3, and this indicates that at most one class of users accumulates in the system and the systems with matching probability 0 < q < 1 behave very similar to the systems with matching probability 1.However, in many real-world problems the matching probability q is very small and we need tools that explicitly address the probabilistic nature of the matchings.In this section, we suggest a second type of diffusion approximation which scales q together with the space and time to get a better description of the dynamics of those systems with small matching probabilities.
We often observe that users are impatient and may leave the system without being matched if they cannot match after waiting for some time.We include this factor in the discussion of the queue length process in the new asymptotic regime, adopting a similar approach to that of Ward and Glynn [18], in which the diffusion limit of an M/M/1+M queue with small abandonment rate is provided.We assume that each user has an exponentially distributed abandonment time with rate γ, 0 ≤ γ < ∞, independent of others, where γ is of the order of the matching probability and γ λ i , i = 1, 2. If the abandonment rate γ is significantly greater than the matching probability, as we scale the system the number of matched pairs is negligible compared to the number of users who abandon the system, and the system starts behaving similarly to two independent M/M/∞ queues.Hence, as we scale space, time and the matching probability, we also let the abandonment rate approach zero.

Fluid limits
Let X n i (t) to be the number of class-i users in a probabilistic matching system where class-i users arrive according to a Poisson process with rates λ i , users abandon the system if they do not match after waiting an exponential time with rate γ (n) = γ n , (0 ≤ γ < ∞), and the matching probability is q (n) = q n , 0 < q < 1.Then, we define to be the scaled system in this regime.Now our goal is to show that as n → ∞, the scaled system approaches the fluid limit X s , which is the unique solution to the following ordinary differential equations (ODEs): Define Equations ( 10) and (11) are in the form dx dt = F(x) = (F 1 (x), F 2 (x)) , where F(•) is Lipschitz on the positive quadrant (its component has bounded derivatives), and hence the initial value problem admits a unique solution.We first show that the solution X s is bounded when γ > 0.
When the matching probability is scaled in such a way that q (n) → 0, the techniques we use to derive fluid and diffusion limits differ from the ones used in Sect.3. In particular, we appeal to Laplace transform methods where a limiting kernel with the corresponding Laplace transform is identified (see, for example, [8] for a brief review of these methods).For this purpose, we need the Lévy kernel for the Markov process.In this paper, we are dealing with continuous-time pure-jump Markov processes which are time homogeneous.Recall that the Lévy kernel of a pure-jump time-homogeneous Markov process X is defined as Specifically, the Lévy kernel of X s,n is given by where δ(y) is the Dirac delta function.Then, we can define the Laplace transform of the operator K n (x, dy) as Now, we are ready to state our result for convergence to the fluid limit.
Theorem 5 For any δ > 0 and T > 0, lim sup and as n → ∞, where X s i , i = 1, 2 is the unique solution to the system of ODEs given by ( 9)- (11).
if we can show that the following three conditions hold: (i) There exists a η 0 > 0 such that The third condition is trivially satisfied as we assume that the probabilistic matching system is initially empty and we have X s,n (0) = 0 for all n.When γ > 0, the first condition follows as when x ∈ S for any η 0 > 0 and θ ≤ η 0 we have Similarly, when γ = 0, the supremum can be bounded by (λ 1 + λ 2 )e η 0 + λ 1 + λ 2 .To prove the second condition, we write Then it is easy to see pointwise convergence ∂m n (x,θ) ∂θ | θ=0 → F(x) and when γ > 0 the uniform convergence follows from continuity of the functions and the compactness of the underlying set.When γ = 0, to prove the uniform convergence we directly use the definition.In particular, we need to show that for any > 0 there exists N such that when n > N , we have for any x ∈ R ≥0 , |(1 − q n ) nx − e −qx | < .First we show that for any > 0 there exists N 1 and c such that when n > N 1 and x > c, we have |(1 − q n ) nx − e −qx | < .We know that ln(1 − q n ) n → −q as n → ∞.For any δ 1 such that 0 < δ 1 < q, we can find an N 1 such that for n > N 1 , we have x ln(1 − q n ) n < x(−q + δ 1 ).As a result, letting c 1 = ln 2 −q+δ 1 , when x > c 1 , we have ln(1− q n ) nx < x(−q +δ 1 ) < ln 2 , or equivalently, (1− q n ) nx < 2 .Moreover, we know that as x → ∞, e −qx → 0. We can find a c 2 such that when x > c 2 , e −qx < 2 .Letting c = max(c 1 , c 2 ), the statement follows.Next, due to compactness and pointwise convergence, we know that for x ∈ [0, c], there exists an N 2 such that for n > N 2 , we have we have the uniform convergence for any x ∈ R ≥0 .As a result, the uniform convergence result for our system when γ = 0 follows.Therefore, (15) follows from Proposition 5.1 in [8].When γ = 0, T n = T a.s.When γ > 0, Eq. ( 15) implies that there is a η > 0 such that for large enough n i.e., for any given δ > 0 the probability scales in the order of e −n .Using the Borel-Cantelli lemma, for any δ > 0, i.e., there exists an Ω with P(Ω ) = 1 such that for ω ∈ Ω and n > N δ (ω) Choose δ < (C i − λ/γ )/2 for ω ∈ Ω and n > N δ (ω), suppose that T n (ω) < T and we can reach a contradiction, as T n (ω) < T implies that there exists a t < T n such that X s,n i (ω, t ) > C i − δ.This implies that T n a.s.→ T .
When there are abandonments (γ > 0), the right-hand sides of ( 10) and ( 11) involve both e −qx and x terms, which makes it difficult to obtain an analytical solution.
However, when the customers do not abandon the system, the ODEs can be solved analytically.Corollary 6 presents this special case.

Corollary 6 When
Proof Setting γ = 0 and taking the integral of ( 10) and ( 11), we see that Then, we have and y(0) = 0, which has the unique solution y(t) = 1 q ln(e λ 1 qt + e λ 2 qt − 1) and the result follows.
In [3], certain performance measures are proven to be independent of the matching probability q under some control policies.Specifically, [3] considers admission control policies which accept users from class-1 only when X 1 (t) ≤ X 2 (t) + d (similarly accept class-2 users only when X 2 (t) ≤ X 1 (t) + d), where d is a constant, and prove that the difference between long-run average queue lengths of class-1 and class-2 users does not depend on the matching probability q under this admission control policy in Theorem 14. Investigating the proof of this theorem, we see that the global balance equations do not change in a way affecting the result when there are abandonments, and a similar result can be proven.Then letting d → ∞ one might expect the same property for the uncontrolled system.The following corollary confirms this result in the fluid limit and indicates a similar property even under the presence of user abandonments.

Corollary 7 When
with initial condition x(0) = 0. Using integrating factors, the solution of this first order ODE can be obtained as Corollary 7 implies that when γ > 0, the matching probability q does not affect the difference between the numbers of class-1 and class-2 users in the system.As t → ∞, this difference converges to λ 1 −λ 2 γ , which coincides with the results of [18] for the M/M/1 + M queue with has arrival rate λ 1 , service rate λ 2 and abandonment rate γ > 0.
Next, we analyze the asymptotic behavior of the fluid limits as time goes to infinity.Corollary 6 assumes γ to be 0 and allows us to compare X s (t) with the fluid limits X (t), given in Theorem 2. Different from X (t), which does not carry any information on the matching probability q, the fluid limits in Corollary 6 depend on q.When t is small, X s i (t) grows for both i = 1 and 2 as q increases.However, as t becomes larger, the influence of the matching probability becomes weaker.Proposition 8 shows that the fluid limits X s (t) converge to X (t) as t → ∞.
Proof Without loss of generality, we assume that λ 1 ≥ λ 2 .Then using Corollary 6 and Theorem 2, we have In other words, we can explain the dynamics of a probabilistic matching system in the following way: Without considering the effect of user abandonments, if each pair of users gets harder to match with each other, we observe more users waiting in the system.However, if we run the system long enough, the average numbers of users in the system only depend on the arrival rates.Next we show that for general abandonment rate γ ≥ 0, the fluid limits of the queue length processes converge to a fixed point as t → ∞.
, where x * i ∈ R satisfies the following set of equations: Proof First, we prove that Eqs. ( 19) and ( 20) have a unique solution.Subtracting the second equation from the first one x * 2 = x * 1 + λ 2 −λ 1 γ , and replacing this into (19), we get The left-hand side of the equation is decreasing in x * 1 , equals λ 1 e − q(λ 2 −λ 1 ) γ > 0 if x * 1 = 0 and goes to −∞ as x * 1 → ∞.Hence, using the intermediate value theorem we conclude that ( 19) and ( 20) have a unique solution and x * = (x * 1 , x * 2 ) is the unique fixed point of the system of equations ( 9)- (11).
When λ 1 = λ 2 , X s (t) solving ( 9)-( 11) converges to x * as t → ∞, if we can find a Lyapunov function V (x) with the following properties (see, for example, Strogatz [17]): Without loss of generality, we assume that λ 1 > λ 2 and define , we have V (x * ) = 0 and V (x) = 0 for all x = x * .Applying Corollary 7 we have and hence V (x) > 0. The second condition follows as which is negative.Therefore, x * is globally asymptotically stable: For all initial conditions, X s (t) → x * as t → ∞. When x * 2 we need to show that X (t) → x * , t → ∞, where X (t) and x * satisfy the following equations: The right-hand side of ( 22) is a decreasing and ( 22) is easily seen to have a unique solution.Equation ( 21) defines a gradient system with potential function U (x) = λx + 1 2 γ x 2 + 2λ q e −qx , i.e., it can be written as d X (t) dt = −∇U ( X (t)), where U (x) is a continuously differentiable, single-valued scalar function.Hence, using Theorem 7.2.1 in Strogatz [17] The fixed point x * in Proposition 9 can be thought of as the long-run average of the respective numbers of users of two classes.Hence, the customer abandonment rates in the steady state can be estimated as γ x * .Using the input-output balance, the matching rate, i.e., the average number of users matched in unit time, can also be estimated as λ i − γ x * i Now, we analyze how x * behaves for different values of the abandonment rate γ .It is reasonable to expect that x * should decrease as abandonment rate increases, which always holds for the user class with the higher arrival rate.However, Proposition 10 shows that for the class with lower arrival rate x * first increases and then decreases as γ increases.

Proposition 10 Suppose λ 1 ≥ λ 2 . Then the long-run average number of class-1 users, x *
1 , decreases as the abandonment rate γ increases, while the long-run average number of class-2 users, x * 2 , increases when and decreases when the inequality is reversed.
Proof Manipulating Eq. ( 19) to obtain x * 2 , substituting in Eq. ( 20) and doing cancellations, we get Taking the implicit derivative of x * 1 with respect to γ , we obtain Letting q and substituting Eq. (23) into Eq.( 24) to get rid of the logarithm terms, we get Since D 1 and D 2 are always positive, when λ 1 ≥ λ 2 , the right-hand side of Eq. ( 25) is always negative, and hence as γ increases x * 1 increases.Interchanging x * 1 and λ 1 with x * 2 and λ 2 , the right-hand side of Eq. ( 25) is positive when Hence, the conclusion for x * 2 follows.
Proposition 10 shows that as γ increases, the limiting number of users for the class with lower arrival rate first increases and then decreases, and the limiting number of users for the class with higher arrival rate decreases monotonically, which agrees with the observations in Fig. 3.This behavior can be explained as follows.As the abandonment rate increases, users from both classes tend to abandon the system a lot faster and hence the arriving users from the class with lower arrival rate are less likely find a match.The decrease in the number of matches is higher than the increase in the abandonments, and as a result, we observe a certain level of accumulation in the limit for users from the class with lower arrival rates.

Diffusion limits
Now, we move to the discussion of the diffusion limits when the matching probability and the abandonment rate are both scaled to study the fluctuations of the queue lengths around the fluid limit X s (t).We define To prove weak convergence, we again use convergence of generators techniques in [8].
is the unique solution to the system of ODEs given by ( 9)- (11).Denote and further define Then we have X s,n ⇒ X s , where and X s (t) = ( X s 1 (t), X s 2 (t)) be the unique solution to system of ODEs given by ( 9)- (11).We first show that X s,n (t) ⇒ X s (t), where X s (t) is treated as a column vector and is the unique solution to the stochastic differential equation ) is a two-dimensional standard Brownian motion.Defining S as in the proof of Theorem 5 and F(x) as in Eq. ( 12), the weak convergence follows from Lemma 5.5 in [8], if we can show that the conditions below hold: Condition (a) is trivial and condition (b) reduces to showing which is elementary calculus, and hence (b) holds as well.Finally which is Lipschitz on R 2 ≥0 .Using Lemma 5.5 in [8], X n ⇒ X s as n → ∞, where X s (t) is the unique solution to the stochastic differential equation (28).Next we show that (26) and ( 27) together is the unique solution to (28), which can be expressed as Defining z i (t) = e γ t X s i (t), i = 1, 2, and using integration-by-parts, we obtain and similarly dz 2 Solving Eq. ( 30) directly, we obtain that Substituting that z 2 (t) = z(t) + z 1 (t) into Eq.( 29) and moving z 1 (t) to the left-hand side, we have Now, multiplying both sides by the integrating factor z 3 (t) = e t 0 a 1 (s)+a 2 (s)ds , we get As a result, Theorem 11 indicates that if the fluid limit X s (t) is given the diffusion limit can be fully characterized analytically.However, as we have seen in Sect.4.1, it is not possible to analytically solve the ODEs for the fluid limit when γ > 0. In the next section, we present numerical experiments to study fluid and diffusion limits presented in this section.

Numerical experiments
We now present a numerical analysis of the properties of the fluid and diffusion limits and investigate their performance as approximations to the matching systems.In Sect.5.1, we use discrete-event simulation to compare the fluid limit presented in Sect.4.1 with the original matching systems.In Sect.5.2, we resort to numerical methods for solving ODEs and SDEs to study the fluid and diffusion limits.

Fluid limits as approximations to the probabilistic matching systems
In Sect.4.1, we prove that if the matching probability and the abandonment rate goes to zero as we scale time and space, the matching process converges to a fluid limit which can be expressed as the solution of the ordinary differential equations ( 9)- (11) and these fluid limits converge to the fixed points which solves (19) and (20).This suggests that for "small" matching probabilities and abandonment rates, fluid limits approximate the probabilistic matching systems and the fixed point can be used as an approximation of the average queue lengths of matching queues.Defining L i to be the long-run average number of class-i users in the system, we now investigate the performance of these approximations and present our results in Tables 1 and 2. The performance measures presented for probabilistic matching systems are obtained using discrete-event simulation.
Table 1 presents a comparison between fluid limits and actual probabilistic matching systems when the arrival rates for both classes are equal.Due to symmetry, the coordinates for the fixed point are equal, i.e., x * 1 = x * 2 = x * , and this value is presented in the third column.In a similar manner, the fourth column presents the average queue length for each class (L = L 1 = L 2 ) as observed in our simulations.The approximation error is given in the fifth column as a proportion of the average queue length.The last two columns correspond to the matching and abandonment rates, respectively.We see that when the matching probability is at most in the order of the abandonment rate normalized by the arrival rate (γ /λ 1 ), then the fluid approximation provides a good approximation.On the other hand, when the matching probability is significantly greater than the normalized rate, the fluid limit approximation starts to deviate from the real values.
Table 2 presents the performance of fluid limits when λ 2 = 2λ 1 .Similar to our results with equal arrival rates, we see that when the abandonment rate normalized by the lower arrival rate (γ /λ 1 ) is an order of magnitude less than the matching probability, the long-run average number of class-1 users in the system is close to zero and there is significant accumulation of the class-2 users, so that arriving class-1 users find a match upon their arrival.This is an indicator that when the normalized abandonment rate is significantly less than the matching probability, the system behaves similar to the case where the matching probability is equal to one as in the scaling we present in Sect.3.However, when the matching probability is at most of the order of normalized abandonment rate, then significant numbers of class-1 users wait in the system and the second scaling in Sect. 4 performs well.

Numerical analysis of properties of fluid and diffusion limits
In Sect.4, we show that when the matching probability and abandonment rate are scaled to go to zero along with the time and space, the fluid and diffusion limits can be expressed as the unique solutions to some systems of ODEs and SDEs which do not have explicit solutions in general.To gain some insight into the solutions, we study numerical approximations in this section.We use Euler and Euler-Maruyama  Fig. 1 Fluid limits when λ 1 < λ for various q. a Fluid limit of user 1 for different q. b Fluid limit of user 2 for different q methods to obtain numerical solutions of ODEs ( 9)-( 11) and SDEs (28), respectively.(See Kloeden and Platen [13] for more details.)To study the fluid limit which is the unique solution to the system of ODEs ( 9)-( 11), we apply the Euler method with step size h = 10 −6 .First, we test the effect of the matching probability q on the fluid limits.First we consider the case λ 1 < λ 2 by setting λ 1 = 200, λ 2 = 400, γ = 0.5 and compute the fluid limits for q = 0.01, 0.02, 0.03.The results are given in Fig. 1.We observe that for the class with lower arrival rate, the number of users in the system demonstrates a very sharp increase at the beginning and then decreases approaching a limit as t goes to infinity.We see that there is a considerable difference between the number of users corresponding to different matching probabilities for this class.On the other hand, the number of users for the class with higher arrival rate grows monotonically, converging to its supremum as t goes to infinity.Surprisingly, the matching probability does not play a significant role for this class and the fluid limits corresponding to different matching probabilities are very close.
To test the case where λ 1 = λ 2 , we performed the same experiment by taking λ 1 = λ 2 = 200.Figure 2a demonstrates that the number of users for both classes increases monotonically as t goes to infinity approaching to the supremum, which is very similar to the behavior of the class with higher arrival rate when the rates are not equal.However, in this case the matching probability has a major effect on the limiting number of users and as q increases the number of users in the system decreases.Also as q gets larger, we see that the number of users increases to its supremum faster and the fluid limit is steeper.
Next we study the effect of the abandonment rate γ on the number of users in the system.In this set of experiments, we set the arrival rates λ 1 = 200, λ 2 = 400 and the matching probability q = 0.01 and vary the abandonment rate.Figure 3 shows that the shape of fluid limits is not affected by the changes in the abandonment rate, i.e., the number of users for the class with lower arrival rate first increases and then decreases and the number of users for the class with higher arrival rate decreases monotonically.We also see that when there are abandonments the number of users for the class with lower arrival rate does not converge to 0 as t goes to infinity.In Fig. 2 Fluid limits when λ 1 = λ 2 for various q. a limit of user 1 and 2 for different q. b Fluid limit of user 1 and 2 for different q Fig. 3 Fluid limits when λ 1 < λ 2 for various γ .a Fluid limit of user 1 for various γ .b Fluid limit of user 2 for various γ agreement with Proposition 10, we see that the limiting number of users for the class with lower arrival rate increases in our experiments as the abandonment rate increases.Now, we discuss numerical approximation to diffusion limit, which is the unique solution to the system of SDEs (28).In our experiments, we apply the Euler-Maruyama method with the step size h = 10 −6 .We again start with the case when the arrival rates are not equal and set λ 1 = 200, λ 2 = 400.Figures 4 and 5 demonstrate some sample paths.We see that there are always significant fluctuations for the class with higher arrival rate.When q is fixed, we see that the changes in γ do not have a major effect on fluctuations.We also see that the fluctuations for the class with lower arrival rate diminish as t increases.However, as q increases, the fluctuations tend to diminish after some time.This is due to the fluid limit approaching zero.Finally, we observe in Fig. 6 that when the arrival rates are equal and set to be λ 1 = λ 2 = 200, both queue length processes keep fluctuating as usual.
Fig. 4 Diffusion limits when λ 1 < λ 2 for various γ a Diffusion limit of user 1 for various γ .b Diffusion limit of user 2 for various γ Fig. 5 Diffusion limits when λ 1 < λ 2 for various q. a Diffusion limit of user 1 for various q.b Diffusion limit of user 2 for various q Fig. 6 Diffusion limits when λ 1 = λ 2 for various q and γ .a Diffusion limit of user 1 for various q.b Diffusion limit of user 1 for various q

Conclusion and future work
In this work, we proposed two different scalings to obtain fluid and diffusion approximations to the queue length processes of probabilistic matching systems.For the first approach, the space and time were scaled while the matching probability is kept fixed.Under this scaling, the matching probability q does not play any role in the fluid limit and the minimum of the queue lengths converges to zero.We suggested that this scaling is used when the matching probability is considerably high.
In the second scaling, we addressed the systems in which the probability to match for each pair of users is small.The effect of abandonments was also taken into account, and the matching probability and the departure rate were scaled along with time and space in this regime.The limiting processes enabled us to address the matching probability explicitly.Unfortunately, the resulting system of ODEs cannot be solved analytically in general, although when there are no abandonments it is possible to obtain an analytical solution.In [3], some performance measures were shown to be insensitive to the matching probability under certain admission control policies.Using fluid limits, we showed that the difference between the average queue lengths of different classes of users is also independent of the matching probability.We also analyzed the asymptotic behavior of the fluid limits in this scaling.First, we showed that when the abandonment rate is zero, the two fluid limits, obtained with and without scaling the matching probability, converge to each other with time.We further showed that when there are abandonments, the fluid limits converge to a unique fixed point, which represents the long-run average number of users in the system.Conducting analysis on the fixed point, we revealed that as the abandonment rate increases, the number of users for the class with lower arrival rate first experiences an increase and then decrease, while the number of users for the class with higher arrival rate decreases monotonically.We also provided extensive numerical results to understand the quality of approximations provided by fluid limits.We saw that if the matching probability is comparable to the normalized abandonment rate or lower our second scaling provides a very good approximation to the real system.However, when the matching probability is significantly higher than the normalized arrival rate, users accumulate in the system and the probability that an arriving lower rate user finds a match approaches one, similarly to what we observe in the first scaling.As analytical expressions are not available for fluid and diffusion limits, we resorted to numerical methods to study the corresponding ODEs and SDEs.We saw that for the class with higher arrival rate, the number of users in the system increases monotonically.On the other hand, the users from the class with lower arrival rate first tend to accumulate in the system and then decrease to a limit as time goes to infinity.This limit is different from zero and increases as the abandonment rate increases, agreeing with our theoretical analysis.This indicates that there are always a significant number of users waiting in the system from both classes.
Probabilistic matching systems exhibit many interesting properties, and we believe the fluid and diffusion limits introduced in this work will be helpful in many directions.First, the approximations introduced here can be used to study the performance of admission control policies which are intractable using exact methods.Another promising research direction is to identify optimal and asymptotically optimal poli-cies to maximize profit generated by charging users admission fees.The probabilistic matching systems studied in this work can also be extended to include different types of users within each class where each type has a different probability to match with users of other classes.Another possible extension is to consider the situation where each arriving user considers only a subset of users from the other class.
2, and matching and scaled processes M•n (t) and Â•n i (t), i = 1, 2 associated with these versions such that Â•n

Table 1
Comparison of fluid limits and simulation results when λ 1 = 1 and λ 2 = 1

Table 2
Comparison of fluid limits and simulation results when λ 1 = 1 and λ 2 = 2