# Avoid matrix multiplication in algebraic multigrid method

Currently when I try to solve a linear algebra system of the form of $$A x =b$$ I use the algebraic multigrid method. The algebraic multigrid method uses a Galerkin product to form the coarse grid matrix ($$A_c = RA_fP$$). Where $$R$$ is the restriction operator, $$P$$ the prolongation operator, $$A_c$$ the coarse grid matrix and $$A_f$$ the fine grid matrix.
In the current state of my implementation I perform the matrix multiplication to form the coarse grid. This step is quite expensive and I was asking myself if there is a way to use the restriction and prolongation operators directly in combination with the fine grid matrix instead of calculating the coarse grid matrix.
The first problem I was facing is to form the strong connection matrix from the fine grid matrix $$A_f$$, the restriction operator $$R$$ and the prolongation operator $$P$$.
Is there any available algebraic multigrid package that is not calculating the coarse grid matrix but using the operators?