Count references to each task in dependency graph.