Refactored logging of graph density to utilities file.