improved graph name/dist-threshold filtering