Given a locally finite graph
$\Gamma $
, an amenable subgroup G of graph automorphisms acting freely and almost transitively on its vertices, and a G-invariant activity function
$\unicode{x3bb} $
, consider the free energy
$f_G(\Gamma ,\unicode{x3bb} )$
of the hardcore model defined on the set of independent sets in
$\Gamma $
weighted by
$\unicode{x3bb} $
. Under the assumption that G is finitely generated and its word problem can be solved in exponential time, we define suitable ensembles of hardcore models and prove the following: if
$\|\unicode{x3bb} \|_\infty < \unicode{x3bb} _c(\Delta )$
, there exists a randomized
$\epsilon $
-additive approximation scheme for
$f_G(\Gamma ,\unicode{x3bb} )$
that runs in time
$\mathrm {poly}((1+\epsilon ^{-1})\lvert \Gamma /G \rvert )$
, where
$\unicode{x3bb} _c(\Delta )$
denotes the critical activity on the
$\Delta $
-regular tree. In addition, if G has a finite index linearly ordered subgroup such that its algebraic past can be decided in exponential time, we show that the algorithm can be chosen to be deterministic. However, we observe that if
$\|\unicode{x3bb} \|_\infty> \unicode{x3bb} _c(\Delta )$
, there is no efficient approximation scheme, unless
$\mathrm {NP} = \mathrm {RP}$
. This recovers the computational phase transition for the partition function of the hardcore model on finite graphs and provides an extension to the infinite setting. As an application in symbolic dynamics, we use these results to develop efficient approximation algorithms for the topological entropy of subshifts of finite type with enough safe symbols, we obtain a representation formula of pressure in terms of random trees of self-avoiding walks, and we provide new conditions for the uniqueness of the measure of maximal entropy based on the connective constant of a particular associated graph.