Discrete potential mean field games: duality and numerical resolution