## 1 Introduction  
Currently, cellular network technologies are unable to counter the growing demand of network subscribers due to various large-bandwidth-demanding applications such as video streaming and mobile computing, etc., and the volume of the data is increasing every day. It is predicted that, by 2025, trillions of wireless devices will be serving billions of people [1]. Beekeeping in Africa has been practiced for many years through successive generations and along inherited patterns. The activity has been traditional and of a non-commercial nature, with honey mostly being used as a food product, in medicine, and for brewing traditional liquor. Many development organizations have been involved in supporting beekeeping activities with producer organizations, but despite these attempts, the sector remains underdeveloped. Beekeepers also face challenges in accessing consistent and business-driven markets for their bee products. In addition, the honey bee population is decreasing due to colony collapse disorder (CCD), and information on the environmental conditions (e.g., temperature and humidity) surrounding beehives is not available to beekeepers due to the lack of monitoring and evaluation systems. To address these challenges, the deployment of smart beehives is essential. Internet of Things (IoT) technology has proved critical in driving the acceleration of the adoption of smart beehives. These innovative beehives enable an analysis of the conditions within the hive and the monitoring of environmental changes and potential threats. By providing real-time data and insights, smart beehives empower beekeepers to make informed decisions, optimize their honey production, and mitigate risks to bee health. Implementing such technologies can play a crucial role in advancing the beekeeping industry and ensuring its sustainability. As with any other IoT-based system, the implementation of smart beehives also has its challenges. Issues such as power supply, data management, and connectivity pose obstacles to their widespread adoption. To overcome these challenges, the integration of 5G and device-to-device (D2D) communication technologies stands out as a promising solution. These advancements can enhance power efficiency, improve data transmission and management, and ensure robust connectivity [2]. It is against this background that this work proposes a novel algorithm that analyzes smart beekeeping D2D communications in terms of their energy efficiency and throughput while using 5G wireless networks. The energy efficiency of smart beekeeping systems is an important aspect to consider for their successful implementation. 5G technology has been recognized as a promising solution that aligns with the goals of next-generation wireless communication networks (NGNs), offering improvements in terms of quality of service (QoS), including throughput, energy efficiency, delay, and supporting D2D communication [3]. Therefore, to improve the efficiency of smart beehives, 5G and D2D communication technologies can be incorporated to support smart beekeeping [4]. D2D communication enables direct communication between devices without the need for intermediate infrastructure, e.g., access points (APs) and base stations (BSs) [3]. Furthermore, D2D communication increases a system's coverage, as it enables closed devices to relay data received from an unenclosed device. By supporting proximity-based data sharing, naturally, D2D communication is the right communication technology in 5G. Smart beekeeping with D2D (SBD2D) communication is being designed for the remote monitoring and timely reporting of the health status of bees, various environmental aspects, and the status of honey production [3]. Energy efficiency is one of the main concerns in a wireless sensor network because grid power is not available everywhere [5]. Alternatively, battery power can be used, but this is not appropriate because a battery's life cycle is very short and requires frequent replacement, making the system expensive.