Optimize transition matrix representation