Efficient Model Determination for discrete graphical models