Understanding Polynomial Time Complexity

In summary, an exponential time algorithm means that it takes a very long time to complete, often expressed as a^n, while a polynomial time algorithm can be completed much faster, often expressed as a polynomial function such as n^2. The difference between the two is significant and understanding their run times can greatly impact the efficiency of a program.
  • #1
teng125
416
0
can sombody pls explain to me what does exponential time algorithm means??

thanx
 
Physics news on Phys.org
  • #3
it is just some very basic computer question which is algorithm.It is not a programming problem.
It means an algorithm which take exponential time to complete and another type is it takes polynomial time to compete an algorithm.

Therefore,i do not understand what it means by exponential time and polynomial time
 
  • #4
If an algorithm takes exponential time, that usually means that it can be done in
[tex]\Theta (a^n)[/tex] time for some constant a.
If an algorithm takes polynomial time, that usually means it can be done in
[tex]\Theta (P(n))[/tex] time for some polynomial P.
Are you familiar with [tex]\Theta[/tex], O, or [tex]\Omega[/tex] notation?
 
  • #5
Just to show a quick example of polynomial time. Say you have two nested for loops,
for (i=1; i<n; i++) {
for (j=1; j<n; j++) {}
}

we can see that j goes to n as i = 1, then j goes to n as i = 2...you see a pattern? j goes to n, n times. Thus our running running time is
n * n ...which also happens to be n^2...this is what is meant by polynomial time..a run time that can be expressed in polynomial form..[tex]a_nx^n + a_{n-1}x^{n-1} + \cdots + a_0[/tex]
 

1. What is an exponential time algorithm?

An exponential time algorithm is a type of algorithm that has a running time that grows exponentially with the input size. This means that as the input size increases, the time it takes for the algorithm to complete also increases significantly.

2. How is an exponential time algorithm different from other types of algorithms?

Unlike polynomial time algorithms, which have a running time that is directly proportional to the input size, exponential time algorithms have a running time that grows much faster. This makes them less efficient for solving large-scale problems.

3. What types of problems are commonly solved using exponential time algorithms?

Exponential time algorithms are often used to solve problems that are NP-complete, meaning that they are difficult to solve using traditional algorithms. These problems include the traveling salesman problem, the knapsack problem, and the graph coloring problem.

4. Are there any advantages to using an exponential time algorithm?

While exponential time algorithms are generally less efficient than other types of algorithms, they can still be useful for solving certain types of problems. For example, they may be the only way to accurately solve an NP-complete problem within a reasonable amount of time.

5. How can the efficiency of an exponential time algorithm be improved?

There are a few ways to improve the efficiency of an exponential time algorithm. One approach is to use heuristics, which are techniques that make an educated guess at the solution instead of exhaustively searching all possible solutions. Another approach is to use parallel processing, which involves breaking the problem into smaller parts and solving them simultaneously on different processors.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
940
  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
11
Views
939
  • Engineering and Comp Sci Homework Help
Replies
1
Views
532
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
16
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
9
Views
991
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
965
Back
Top