
We consider the long term behaviour of a Markov chain \xi(t) on \Z^N based on the N station supermarket model. Different routing policies for the supermarket model give different Markov chains. We show that for a general class of local routing policies, "join the least weighted queue" (JLW), the N onedimensional components \xi_i(t) can be partitioned into disjoint clusters C_k. Within each cluster C_k the "speed" of each component \xi_j converges to a constant V_k and under certain conditions \xi is recurrent in shape on each cluster. To establish these results we have assembled methods from two distinct areas of mathematics, semimartingale techniques used for showing stability of Markov chains together with the theory of optimal flows in networks. As corollaries to our main result we obtain the stability classification of the supermarket model under any JLW policy and can explicitly compute the C_k and V_k for any instance of the model and specific JLW policy.

We consider an exhaustive polling system with three nodes in its transient regime under a switching rule of generalized greedy type. We show that, for the system with Poisson arrivals and service times with finite second moment, the sequence of nodes visited by the server is eventually periodic almost surely. To do this, we construct a dynamical system, the triangle process, which we show has eventually periodic trajectories for almost all sets of parameters and in this case we show that the stochastic trajectories follow the deterministic ones a.s. We also show there are infinitely many sets of parameters where the triangle process has aperiodic trajectories and in such cases trajectories of the stochastic model are aperiodic with positive probability.