Stav dette: Fast memory-efficient generalized belief propagation