An algebraic multigrid approximation of the inverse of the physically damped operators is used as a preconditioner for time-harmonic scattering problems in fluids and solids. The AMG uses graph based coarsening together with underrelaxed Jacobi smoother. Several numerical experiments demonstrate the behavior of the method in complicated two-dimensional and three-dimensional domains. The number of iterations behaves roughly linearly with respect to the frequency. This approach leads to efficient solution procedure for low and medium frequency problems.