We analyse algorithmic the queueing system with two parallel queues supplied with two heterogeneous group of servers. We assume a controllable cross-connectivity of queues with certain class of customers to different groups of servers. The system is analyzed in steady state. For a given cost structure we formulate the Markov decision problem for an optimal allocation of servers between the queues to minimize the long-run average cost per unit of time. The corresponding dynamic programming equations are derived. We develop algorithms to evaluate different performance measures including the mean busy period, the mean number of customers served in a busy period as well as the maximal queue length in a busy period. Some illustrative numerical examples are discussed. © 2020, Springer Nature Switzerland AG.