Optimal Device Selection in Federated Learning for Resource-Constrained Edge Networks