Thoughts on algorithms
I was writing a program today which uses a random calculator to place a thief on a graph then has to breadth search for the thief..just a fun program…then thoughts came into my mind about the strategy of attacking the problems both sides…You have this graph….then you have this two algorithms doing the same job except one is attacking from the front of the graph and one is attacking from the back of the graph (front and back with respect to the information given)… At this point i was thinking to myself its more like having two linear searches in an array…one starting from the front and one from the end…. it will still be a an O(n) algorithm but the funny thing is that the average case changes to a worst case scenario.
If information is given on an array of 30 and the probability of finding it in the upper case or lower case is higher than finding it near the middle then this would seem like a good way for a program…However if the probability is more favourable of finding it as you approach the average distribution a normal algorithm would be the case. Its a trivial idea but one that i find very interesting.
This concept raises the thoughts of “what if the algorithms could run simultaneously and not one after the other”? It would definitively reduce the time complexity but only buy a scalar quantity and that is not what we are looking for. Remember that the time complexity is measured by the operation that takes the most time and that takes place most frequently. To end it here would not satisfy me cause i really want to think outside the box. In the future with the constant increase of hardware speed what if the computer reaches a point where it runs n algorithms simultaneously on n data? if this is the case then we would be able to achieve o(1) algorithms and a very very fast computer. Algorithms that run at a constant speed every time you run them.However, all this is just a thought of the future in which we are very far away from. An interesting thing about this idea is that for any linear algorithms we might have to divide it by how many instructions can be done simultaneously with the amount of data that we have.
Something like this :
n/m where m is the amount of instructions that can be done simultaneously as it approaches infinity of course…very interesting if i might say so myself…but to repeat myself this is not really whats happening but just a thought on whats to come in the future.
- There are no comments yet





