math with dependency graphs