Question: I know this could be a strange question. But was there any algorithm ever found to compute an NP-problem, whether it be hard or complete, in polynomial time. I know this dabbles into the "does P=NP" problem, but I was wondering whether there were any particular instances when people were close to it. I've also heard about the factoring number problem being solved by a quantum computer by Shor's algorithm. Would this count as an algorithm which solved an NP-problem in polynomial time please ? Please do ask if you want me to clarify any parts in my questions. Thanks in advance.

Answer: 
If the answer to the first question were to be yes, then $P=NP$, as stated in [nir shahar](https://cs.stackexchange.com/a/139832/61663)'s answer. This has not been done.

### "The easiest NP hard problem"

However you next asked if any NP-hard problems have been solved in ***close*** to polynomial time, for which you might love to learn about what has been called "[The easiest NP hard problem](http://bit-player.org/wp-content/extras/bph-publications/AmSci-2002-03-Hayes-NPP.pdf)" because there's a [pseudo-polynomial time](https://en.wikipedia.org/wiki/Pseudo-polynomial_time) solution using [dynamic programming](https://en.wikipedia.org/wiki/Dynamic_programming), and there are [heuristics](https://en.wikipedia.org/wiki/Heuristic) that solve the problem in many cases, sometimes optimally. The problem is the [partitioning problem](https://en.wikipedia.org/wiki/Partition_problem): Decide whether a set of positive integers can be partitioned into two sets such that the sum of the numbers in one set equal the sum of the numbers in the first set. Despite it being an NP-complete problem, it can be solved quite efficiently, as for example described in [this PDF](https://www.ijcai.org/Proceedings/09/Papers/096.pdf).
Strictly speaking, as the other answers explain, no. A polynomial-time algorithm for an NP-hard problem is not known nor expected to exist. But I think your underlying question is whether or not there are examples of natural NP-hard problems that are, in some sense, easier to solve than some other NP-hard problems.

There are several flavors in which you can quantify the hardness of NP-hard problems more closely. For example, there are problems that are extremely difficult to *approximate* (e.g., maximum clique) while some problems we can approximate arbitrarily close (e.g., knapsack). You could also have a look at *exact algorithms*: there are natural problems for which the best algorithms run in time $O^\*(2^n)$ and there is some evidence no algorithms faster than that exists, while others admit runtimes of roughly $O^\*(2^\sqrt{n})$ (e.g., planar problems) or even better. Or, you could look at *parameterized complexity*, where the idea is to do a two-dimensional analysis, i.e., take not only the size of the input $n$ but also pick some additional parameter, such as solution size or some structural parameter $k$. Then, some problems admit algorithms whose runtime is of the form $f(k) n^{O(1)}$, where $f$ is some computable function depending only on $k$, while some problems don't (e.g., $k$-clique).