Ettore Messina’s
Tech Blog

Queue simulation with M/M/c and M/M/c/K algorithms

Queue Simulation mmck

Overview

The two algorithms simulated in this project are thoroughly described in two dedicated articles. The M/M/c algorithm article covers the mathematical foundations of multi-server queuing systems with unlimited capacity: arrival and service rates, the Erlang C formula, system utilization, average queue length, and Little’s Law. The M/M/c/K algorithm article extends the model to finite-capacity systems, introducing state probabilities, rejection probability, and effective arrival rate — key metrics that emerge when customers are turned away once the system reaches its maximum capacity K. Rather than repeating those concepts here, readers are encouraged to consult those articles for the full theoretical and implementation details.

M/M/c Algorithm

The M/M/c model describes a queuing system with Poisson arrivals, exponential service times, and c parallel servers sharing a single queue of unlimited capacity. The key stability condition is evaluated. When the system is stable, the Erlang C formula gives the probability that an arriving customer has to wait, from which average queue length and waiting time are derived via Little’s Law. For the full mathematical treatment and a working simulation, see the dedicated article: Queue simulation – M/M/c algorithm.

M/M/c/K Algorithm

The M/M/c/K model extends M/M/c by introducing a finite system capacity K: any customer arriving when the system already holds K customers is rejected and lost. This bound makes the system always stable, regardless of the ?/? ratio. The main metrics shift accordingly: state probabilities give the likelihood of having n customers in the system, the rejection probability quantifies the fraction of lost arrivals, and the effective arrival rate is used in Little’s Law to account for rejected customers. For the full mathematical treatment and a working simulation, see the dedicated article: Queue simulation – M/M/c/K algorithm.

FAQ

What is the difference between M/M/c and M/M/c/K queueing models?

In an M/M/c model, customers arrive according to a Poisson process (fixed average arrival rate) and are served by c completely independent service facilities. The system can handle up to c customers in service at any time, but there is no limit on the maximum number of waiting customers. If all c servers are busy, new arrivals wait in an open queue indefinitely.

What is the formula for the average number of customers in an M/M/c/K system?

The average number of customers (L) in an M/M/c/K model combines:
1. Customers waiting (Lq).
2. Customers being served (Lb).

Why do service times in M/M/c/K use exponential distributions?

Exponential distribution is the only continuous probability distribution that satisfies the “memoryless” property—meaning the remaining time before completion is independent of how long the process has already lasted. This ensures: – Natural stochastic behavior (no memory of past events). – Easy mathematical analysis for queueing theory. – Real-world applicability since service times often exhibit randomness and unpredictability.

Related Reads

No Results Found

The page you requested could not be found. Try refining your search, or use the navigation above to locate the post.