Code for dependency graph generation and printing