Worst-Case Asymptotic Complexity

Worst-Case Asymptotic Complexity

(IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 10, No. 3, 2019 An Effective Approach to Analyze Algorithms with Linear O(n) Worst-Case Asymptotic Complexity Qazi Haseeb Yousaf *1, Muhammad Arif Shah*2, Rashid Naseem3, Karzan Wakil4, Ghufran Ullah5 Department of Computer Science, City University of Science and Information Technology, Peshawar, Pakistan1,2,3,5 Research Center, Sulaimani Polytechnic University, Sulaimani 46001, Kurdistan Region, Iraq4 Abstract—A theoretical approach of asymptote analyzes the Machine (RAM) is one of an adapted model for forming algorithms for approximate time complexity. The worst-case approximate algorithmic functions in terms of input size of the asymptotic complexity classifies an algorithm to a certain class. algorithm. RAM has three assumptions: The asymptotic complexity for algorithms returns the degree variable of the algorithmic function while ignores the lower Only one processor terms. In perspective of programming, asymptote only considers Infinite Memory the number of iterations in a loop ignoring inside and outside statements. However, every statement must have some execution Cost of one unit processor time for each binary time. This paper provides an effective approach to analyze the operation and each array access. algorithms belonging to the same class of asymptotes. The theoretical analysis of algorithmic functions shows that the A mathematical set-theoretic approach of asymptotes gives difference between theoretical outputs of two algorithmic the time complexity of an algorithm. Asymptotic notations functions depends upon the difference between their coefficient analyze algorithms for different time complexities. Generally, of ‘n’ and the constant term. The said difference marks the point there are five asymptotic notations in mathematics. These are for the behavioral change of algorithms. This theoretic analysis Big-Oh (O), Big-Omega (Ω), Theta (Θ), Small-Oh (o) and approach is applied to algorithms with linear asymptotic Small-Omega (ω). Big-Oh (O), Big-Omega (Ω) and Theta complexity. Two algorithms are considered having a different (Θ) are used asymptotes to analyze the algorithms [2]. number of statements outside and inside the loop. The results positively indicated the effectiveness of the proposed approach as Big-omega appears for asymptotic lower bound in analysis the tables and graphs validates the results of the derived formula. of algorithm. In computing, it is termed as best-case analysis. Leiserson et al. [1] defines Big-Omega mathematically as: Keywords—Asymptotic complexity; interval analysis; in-depth analysis; Big-Oh; crossover point Ω(f(n)) ≥ { g(n) : there exists c > 0 and n0 such that g(n) ≤ c.f(n) for all n > n0. } (1) I. INTRODUCTION Big-Oh represents asymptotic upper bound for the An algorithm is a set of instructions to specify a solution to analysis, when input size becomes so big that it tends to the problem in a finite time. The single problem may have infinity, which is normally termed as worst-case analysis. more than one algorithm. For instance, algorithms to search Leiserson et al. [1] defines the equation of Big-Oh as follow: maximum value in one-dimensional array or methods to sort elements in an array. Given the number of algorithms for a Ο(f(n)) = { g(n) : there exists c > 0 and n0 such that f(n) ≤ problem, it is obligatory that every algorithm differs in the c.g(n) for all n > n0. } (2) order of complexity. Considering the difference in complexity Theta shows tight bound for given function. It gives the of algorithms, some algorithms perform better than others in average case analysis in computing. From mathematical the provided environment. The level of complexity effects in definition stated by Leiserson et al. [1] execution time, the memory space acquired and lines of code (LOC) for the algorithms. From the given three metrics of θ(f(n)) = { g(n) if and only if g(n) = Ο(f(n)) and g(n) = Ω(f(n)) complexity, LOC has no direct impact on algorithm for all n > n0. } (3) complexity and is not considered a good metric for analysis of algorithm [1]. Therefore, execution time and space acquired Given in the above defined equations (1), (2) and (3), n is are metrics for analysis of algorithms. The run-time of the the input size for algorithm. It may be size of array, stack or algorithm is measured either by approximate analysis or basic data structure to hold memory. f(n) represents execution time on the machine. Real execution time requires mathematical function of algorithm and g(n) is the comparable computational resources to run algorithms in actual time. The function or asymptote. computational resources are affected by the environmental The algorithms are compared on their worst-case analysis factors like temperature, number of resources utilized, [3]. If the results of the worst-case analysis for two algorithms dimensions of used resources etc. In contrast, the approximate are the same, then the second metric to analyze the algorithms method follows a virtual computational model. The virtual is best-case analysis. The problem arises when the worst-case computational model depends on certain fixed execution times and best-case analysis gives the same time complexity. It for different programming structures. Random Access becomes difficult with asymptotes to analyze the better 337 | P a g e www.ijacsa.thesai.org (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 10, No. 3, 2019 algorithm from the given pool [4]. The problem of analyzing approximated results theoretically but with accuracy payoff. the algorithm with the same time-complexity is discussed by Tarek [2] wrote on the set-theoretic approach of asymptotes [2,4,5] in their respective papers. Leiserson et al. [1] and i.e. asymptotic functions are relative functions than individual Sedgewick et al. [3] in their books quoted a generalized bare ones. This means asymptotic functions always depend on statement for the above-discussed problem that “Asymptotic coefficient and exponents of input size n. The extended work big-Oh approximations are for the functions tend towards of Decelle et al. [16] was an exact analysis of the stochastic infinite large values”. This means with asymptotes, analysis block model. The author used an asymptotic approximation for small input values is not feasible. So this traditional for analysis. A research study [17] on non-asymptotic analysis approach is not enough to analyze and choose the best of machine learning algorithms may be in principle costly to algorithm from the given set [2–4]. Moreover, the real-world generate results beyond a certain number of equations. Teng problems work with a specific interval of inputs. While [18] discussed linear time algorithms for preconditioning and asymptotes give us peak value analysis. It ignores the in- solving dominant linear systems. Xu et al. [19] explore the between behavior of an algorithmic function. The alternative algorithms for Virtual Machine (VM) deployment and load method to differentiate the same asymptotic time complexity balancing. The research included certain new metrics to algorithms is real-time analysis on RAM. The RAM technique conclude for the best performing algorithm in the deployment is a theoretical analysis requires less time and is not affected and load balancing of VM. The proposed and existed all by certain environmental factors. Rahman [4] proposed two metrics are environmental variables dependent on the applied theoretical approaches (i) graph analysis and (ii) interval platform. Pietri et al. [20] give the survey of VM deployment analysis [4]. Interval analysis works on a mathematical point on Physical Machines (PM). The adopted techniques were of intersections for two or more functions. Full mathematical proven correct but research was inconclusive about the best implementation of point of intersection contains a number of technique. Thi and Thi [21] published work on the same calculating steps with an overload of undesirable results in problem of approximated the complexity of algorithms using many cases like imaginary values, negative integer values, and asymptotes. The work suggested statistical and probability continuous values. To some extent, the point of intersection formulas resulting in equivalent values that of asymptotes. approach throws an idea to check for the positive integer The formula calculates sorting algorithms realistic complexity. where the crossover occurs between the two algorithmic The method is partially automated and most calculations are functions. This paper suggests a solution, which will analyze done manually. In addition, the method depends on the type algorithms with the same asymptotic complexity, but different and nature of input [21]. algorithmic functions. The proposed method finds approximate number „n ‟, where n is the point from which the The above studies show that authors are inconclusive to o o decide between algorithms. For the same degree of two algorithmic functions start changing their behaviors. different algorithmic functions asymptotes failed to analyze II. LITERATURE REVIEW them for small or large input sizes. Asymptotes treat them equally good for all input sizes, which is not exactly the case. Algorithms are analyzed and validated from the very start The inference is to replace asymptotic analysis by realistic of programming, for example, Garey et al [6], discussed the analysis specifically for same worst-case complexity memory allocation algorithms for complexity

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    6 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us