matrix form of a multi-queue problem