modification to create graph of common sub-packages