This study extends the concept of time complexity to energy, i.e., energy complexity, by showing a strong correlation between time complexity and energy consumption for sorting algorithms: Bubble Sort, Counting Sort, Merge Sort and Quick Sort, written in Java and run on single kernels. We investigate the correlation between wall time and time complexity, as well as the correlation between energy consumption and wall time. The primary finding is that time complexity can be used as a guideline to estimate the energy consumption of O(n*n), O(nlog(n)) and O(n + k) sorting algorithms. The secondary finding is that the inputs producing the theoretical worst cases for Merge Sort and Bubble Sort did not produce the worst case wall time nor the worst case energy consumption.
翻译:本研究通过展示用Java编写并在单核上运行的排序算法(冒泡排序、计数排序、归并排序和快速排序)的时间复杂度与能耗之间的强相关性,将时间复杂度概念扩展至能耗,即能耗复杂度。我们考察了实际运行时间与时间复杂度之间的相关性,以及能耗与实际运行时间之间的相关性。主要研究发现是,时间复杂度可用于指导估算O(n*n)、O(nlog(n))和O(n + k)类排序算法的能耗。次要发现是,对于归并排序和冒泡排序,产生理论最坏情况的输入并未导致实际运行时间最坏情况或能耗最坏情况。