Further Maths, D1 - Dijkstra's Algorithm

  • Thread starter I-need-help
  • Start date
  • Tags
    Algorithm
In summary, The conversation discusses the concept of "Order of the Algorithm" in relation to Dijkstra's Algorithm. The order is determined to be n^2, and this means that the problem can be solved in Cn^2 steps. The conversation also mentions the use of a new computer with a speed 100 times faster, which would allow for a larger problem size to be solved in the same amount of time. However, it is noted that this may not be relevant for the D1 exam.
  • #1
I-need-help
15
0
Hi, I can do Dijkstra's Algorithm alright, but I always have problems with questions which have some relevance to the "Order of the Algorithm".

For example, in the Further Maths, Decision 1 (OCR) textbook:

8) Suppose you purchase a new computer which is 100 times as fast as your old one. What gain in problem size per hour would you achieve in the use of Dijkstra's Algorithm? Show all necessary working.

I know that the order of Dijkstra's is n2 - a quadratic- and that you could use the relationship of: t α n2

Please help me!

Thank You :)
 
Physics news on Phys.org
  • #2
If the order of the algorithm is n^2, this means there's a constant C, such that the problem can be solved in Cn^2 steps.

Suppose that you're willing to wait a time T for the answer. The speed of your old computer is v of those steps each second, so it can do vT steps in time T, and you can do problem sizes n, such that cn^2 < vT. This means that n has to be smaller than .....

Now your new computer has speed 100v, so you can just replace v by 100 v in the condition for n you calculated before
 
  • #3
@willem2 Thank you for the reply! That makes so much sense to me now. Thanks
 
  • #4
Do we have to know that for the D1 exam (just because I'm taking it and I didn't really expect that)?
 
  • #5
dalcde said:
Do we have to know that for the D1 exam (just because I'm taking it and I didn't really expect that)?

Hmmm, after looking at several past papers, it doesn't seem as if they would ask you anything like that. But be careful anyway, they do randomly throw related things in there.
 

1. What is Dijkstra's Algorithm?

Dijkstra's Algorithm is a popular algorithm used to find the shortest path between two nodes in a graph. It is commonly used in computer science and mathematics, particularly in the field of graph theory.

2. How does Dijkstra's Algorithm work?

Dijkstra's Algorithm works by building a shortest path tree from the starting node to all other nodes in the graph. It considers all possible paths and chooses the one with the shortest distance at each step, until the shortest path to the destination node is found.

3. What is the time complexity of Dijkstra's Algorithm?

The time complexity of Dijkstra's Algorithm is O(V^2), where V is the number of vertices in the graph. This means that the running time of the algorithm is directly proportional to the square of the number of vertices in the graph.

4. What are the applications of Dijkstra's Algorithm?

Dijkstra's Algorithm has a wide range of applications in various fields, such as computer networking, transportation planning, and map routing. It is also used in various problems related to finding the shortest path, such as the traveling salesman problem.

5. Can Dijkstra's Algorithm handle negative edge weights?

No, Dijkstra's Algorithm cannot handle negative edge weights. This is because the algorithm assumes that all edge weights are positive, and using negative edge weights can lead to incorrect results. In such cases, other algorithms like the Bellman-Ford Algorithm can be used.

Similar threads

Replies
22
Views
903
Replies
4
Views
2K
Replies
2
Views
863
  • STEM Academic Advising
Replies
9
Views
1K
  • STEM Academic Advising
Replies
11
Views
1K
  • Programming and Computer Science
Replies
2
Views
2K
  • STEM Academic Advising
Replies
13
Views
2K
  • STEM Academic Advising
Replies
4
Views
2K
  • General Discussion
Replies
4
Views
652
  • Science and Math Textbooks
2
Replies
38
Views
6K
Back
Top