Martin capacity for Markov chains and random walks in varying dimensions