Potential games for subcarrier allocation in multi-cell networks with D2D communications