SQL ALGORITHM FOR SOLVING MARKOV MODELS BY GRAPH METHOD SQL ALGORITHM FOR SOLVING MARKOV MODELS BY GRAPH METHOD

A simple graph algorithm for finding stabilized probabilities of the finite Markov models implemented in SQL is presented. The algorithm generates systematically all oriented spanning trees of a transition graph. The method is demonstrated on the computation of probabilities in the MMPP 2 /M/1/K queue.


Introduction
The original graph study of steady-state distribution for stabile Markov process with finite state sets is presented by Markl [1]. Stabilized probabilities of the stable Markov process associated with a weighted digraph (called transition graph) G ϭ (S, E , c) are given by formulas where B i , i ʦ S is the sum of weights of all the spanning trees of G that have their roots in vertex i.
For processes with many states and many possible transitions between them is not easy to find all spanning trees. We apply a simple algorithm that systematically generates all spanning trees with given roots in SQL.

Basic definitions
We start with giving the some definitions from graph theory that will be used in this paper. A (simple) digraph G ϭ (V, E) consists of a finite set V of vertices and set E of edges -ordered pairs of distinct vertices; that is, each A digraph in which each pair of vertices lies on a common cycle is called strongly connected. A digraph in which for each pair {u, v} ʦ V exists u Ϫ v path or v Ϫ u path is called connected. The component of a digraph is maximal connected subgraph of a digraph.
A digraph that has no cycle is called a directed acyclic graph (DAG). A rooted tree is a DAG in which one vertex, the root, is distinguished and in which all edges are implicitly directed to the root. (Note that in the standard definition [7] of the rooted tree the orientation of the edges is away from the root.) The weight of the (edge) weighted rooted tree T ϭ (V, E T , w) we mean number A spanning rooted tree (T, r) with root r, shortly spanning r-tree, of a strongly connected digraph G is a rooted tree T that is a subgraph of G and that contains every vertex of G. The weight of the a spanning r-tree

SQL algorithm
The strongly connected digraph G ϭ (V, E) is given. We may assume without loss of generality that V ϭ {1, 2, …, n} and root r ϭ 1. The cases where r 1 can be transformed to the case r ϭ 1 by renumbering of vertices V. Let the set E be represented by a table Edge with two columns: and a table Solution with two columns of array[1, …, n]: • Solution.tree is the subtree -subgraf of spanning 1-tree • Solution.comp is the components of tree.Solution In Figure 1 ϭ [1, 1, 3, 1, 1].

Fig. 2 The subtree of the 1-tree with two components
We can now describe the algorithm which generates all spanning 1-trees:  Before we start the main SQL-algorithm, we calculate the values of null subtree (V,л) with n components. One new edge (u, v) appends in the k-step, if it is possible else subtree is deleted. So the subtrees (V, H k ) where |H k | ϭ k are generated step by step. After the last step we have all spanning 1-trees.
A new subtree and its components are stored in an array tree and comp which are updated by the function: Note that after the last step are comp ϭ [1, 1, 1, …, 1] because the spanning 1-trees are connected digraphs.

Example of MMPP 2 /M/1/K queue
We consider a queueing system studied by Peško [2] with twostate Markov modulated Poisson process MMPP 2 , a single exponential distributed server and a finite waiting room. The problem of switch design and admission control in a high speed network is modeled in [6] as MMPP 2 /GI/1/ϱ queue. The transition graph for the MMPP 2 /M/1/K queue is a weighted digraph  Figure 3 we have the small example of the MMPP 2 /M/1/3 queue with maximal 2 customers in waiting room where ␣ and ␤ are ON and OFF rate of source, is the arrival rate from ON source and the service rate.
We have a  Table 2. After k th step (k ϭ ϭ 1, 2, 3, 4) we have a new Solution in Table 2 with added column of step marked k. All spanning 1-trees are generated in the last Solution table 3 and described in figure 4. And so B 1 -the sum of weights of all the spanning 1-trees is The sum of weights of all the spanning r-trees B r for r ϭ 2, …, 6 can be computed by renumbering set of vertices S.