Brett - modified Tree_calcs to add inter group edge density