# G-network

In queueing theory, a discipline within the mathematical theory of probability, a G-network (generalized queueing network, often called a Gelenbe network) is an open network of G-queues first introduced by Erol Gelenbe as a model for queueing systems with specific control functions, such as traffic re-routing or traffic destruction, as well as a model for neural networks. A G-queue is a network of queues with several types of novel and useful customers:
* positive customers, which arrive from other queues or arrive externally as Poisson arrivals, and obey standard service and routing disciplines as in conventional network models,
* negative customers, which arrive from another queue, or which arrive externally as Poisson arrivals, and remove (or 'kill') customers in a non-empty queue, representing the need to remove traffic when the network is congested, including the removal of "batches" of customers
* "triggers", which arrive from other queues or from outside the network, and which displace customers and move them to other queues
A product-form solution superficially similar in form to Jackson's theorem, but which requires the solution of a system of non-linear equations for the traffic flows, exists for the stationary distribution of G-networks while the traffic equations of a G-network are in fact surprisingly non-linear, and the model does not obey partial balance. This broke previous assumptions that partial balance was a necessary condition for a product-form solution. A powerful property of G-networks is that they are universal approximators for continuous and bounded functions, so that they can be used to approximate quite general input-output behaviours.

## Definition

A network of m interconnected queues is a G-network if
* each queue has one server, who serves at rate μ$_i$,
* external arrivals of positive customers or of triggers or resets form Poisson processes of rate $\scriptstyle {\Lambda _{i}}$ for positive customers, while triggers and resets, including negative customers, form a Poisson process of rate $\scriptstyle {\lambda _{i}}$,
* on completing service a customer moves from queue i to queue j as a positive customer with probability $\scriptstyle {p_{ij}^{+}}$, as a trigger or reset with probability $\scriptstyle {p_{ij}^{-}}$ and departs the network with probability $\scriptstyle {d_{i}}$,
* on arrival to a queue, a positive customer acts as usual and increases the queue length by 1,
* on arrival to a queue, the negative customer reduces the length of the queue by some random number (if there is at least one positive customer present at the queue), while a trigger moves a customer probabilistically to another queue and a reset sets the state of the queue to its steady-state if the queue is empty when the reset arrives. All triggers, negative customers and resets disappear after they have taken their action, so that they are in fact "control" signals in the network,
* note that normal customers leaving a queue can become triggers or resets and negative customers when they visit the next queue.
A queue in such a network is known as a G-queue.

## Stationary distribution

Define the utilization at each node,
    $\rho _{i}={\frac {\lambda _{i}^{+}}{\mu _{i}+\lambda _{i}^{-}}}$
where the $\scriptstyle {\lambda _{i}^{+},\lambda _{i}^{-}}$ for $\scriptstyle {i=1,\ldots ,m}$ satisfy
Then writing (n$_1$, ... ,n$_m$) for the state of the network (with queue length n$_i$ at node i), if a unique non-negative solution $\scriptstyle {(\lambda _{i}^{+},\lambda _{i}^{-})}$ exists to the above equations (1) and (2) such that ρ$_i$ for all i then the stationary probability distribution π exists and is given by
    $\pi (n_{1},n_{2},\ldots ,n_{m})=\prod _{i=1}^{m}(1-\rho _{i})\rho _{i}^{n_{i}}.$

### Proof

It is sufficient to show $\pi$ satisfies the global balance equations which, quite differently from Jackson networks are non-linear. We note that the model also allows for multiple classes.
G-networks have been used in a wide range of applications, including to represent Gene Regulatory Networks, the mix of control and payload in packet networks, neural networks, and the representation of colour images and medical images such as Magnetic Resonance Images.

## Response time distribution

The response time is the length of time a customer spends in the system. The response time distribution for a single G-queue is known where customers are served using a FCFS discipline at rate μ, with positive arrivals at rate λ$^+$ and negative arrivals at rate λ$^−$ which kill customers from the end of the queue. The Laplace transform of response time distribution in this situation is
    $W^{\ast }(s)={\frac {\mu (1-\rho )}{\lambda ^{+}}}{\frac {s+\lambda +\mu (1-\rho )-{\sqrt {[s+\lambda +\mu (1-\rho )]^{2}-4\lambda ^{+}\lambda ^{-}}}}{\lambda ^{-}-\lambda ^{+}-\mu (1-\rho )-s+{\sqrt {[s+\lambda +\mu (1-\rho )]^{2}-4\lambda ^{+}\lambda ^{-}}}}}$
where λ = λ$^+$ + λ$^−$ and ρ = λ$^+$/(λ$^−$ + μ), requiring ρ < 1 for stability.
The response time for a tandem pair of G-queues (where customers who finish service at the first node immediately move to the second, then leave the network) is also known, and it is thought extensions to larger networks will be intractable.