Text this: An optimal energy-efficient resource allocation algorithm in ultra-dense network