Memory constrained algorithms for multi-valued decision diagrams