Tools for graphical inference