Wednesday, January 8, 2014

Life as an NP Complete Problem

Please read the following post with discretion. I have used some technical terms that may confuse some people. For readers who are well versed in combinatorial optimization, please excuse my lack of formal proofs for some of the claims. Please leave a comment and I would be happy to discuss this post.


The Problem Formulation:

Life is an NP complete problem in terms of time. At each instantaneous point in time, we virtually have an infinite amount of paths we can take, each leading to a different 'node' or point of life. At most times, we make a greedy selection of the next step. We select the direction which seems to be most appealing at the time with the information we have. This seems to be the only way of making a sound judgement and selecting a direction to follow. If we were a computer, then we can implement a recursive solution, where we make a decision and follow a certain path, and if it does not work out, we back track and take a different path from the same 'node'. In a computer program, we have the ability to store a time-stamp and revert back to it if necessary. But, of course this is not possible in real life. We can't back track through time. Once we make a decision and choose a direction, we only have the current node to work with. This node leads to a different set of nodes that may or may not be the nodes that were previously visited.

Imagine if Life was like the Travelling salesman problem (modeled as a graph with edges and vertices). If we were given these different moments of life and had to choose the most efficient path through them. Here, I am defining an efficient path as the path that has the least obstacles/pain (cost on edges) and the most rewards/success (vertices), whatever that may be; Love, Money, Fame, Family, or Respect. One can argue that the goal here is not necessarily visit every vertex, as in the travelling salesman problem, but only the "good" ones in the "shortest" possible route, hence it is harder than the travelling salesman problem. To understand this concept better, think about a route where the first few nodes are "far" or incur some pain, but the following ones incur great happiness, hence the overall journey being the relatively best route you can take.

Fig: Illustration of Life modeled as a graph

Understanding the Problem:

How do we figure out this "relatively best route" to get to that vertex (or vertices) of success? I can think of a few real world examples which gives us some idea:

I can argue that going to school can be one such segment of a path that leads to overall happiness. It takes many years of one's life and one is subjected to heavy mental tasks. This may case pain and unhappiness in the first few nodes, but it can eventually lead to a path of success and happiness (eg. a good career, social status, financial stability, etc). To pursue this route, one cannot take the greedy approach of always taking the easiest path. The relative minima has to be crossed in order to achieve true greatness.

On a daily basis, one would choose to take the car instead of walking because it is faster, and requires less effort. While this has the least 'cost' in the short term, this may have a higher overall cost. Walking is better for health, good for the mind, one can do some productive thinking that may/may not lead to something productive (not to say that the same cannot be done in the car, but the probability is less)


The Solution:

One tackles NP complete problems through heuristics, which are not solutions, but a method of achieving the best possible result in the given time. These heuristics are formed through extensive experimentation with different scenarios. Is there a 'heuristic' that will allow you to take the right paths in life leading to overall success? This observer thinks that the 'heuristic' is spirituality and philosophy. If one thinks about life deep enough and tries to understand the purposes of the things s/he does (to a minute detail), then s/he can make the right decisions in life.

In the above example, if one goes to school, not thinking about the end result, but going to school to learn for the sake of learning, then all decisions made during this point of time (i.e. school) will be more favourable for overall success. Contrasting this with the greedy approach, one may not go to school at all, which is arguably less favourable for overall success.

If one has appreciation for nature and what it has to offer, then one would choose walking over driving. This choice is made not greedily (to attain success in the short term), but in fact to enjoy the moment. If one realizes and appreciates the beauty of nature, then one would automatically make the right choice (assuming that walking is the right choice..)

So one heuristic to use for the best possible result in the given time would possibly be what the greats have said all through time. We must do what we aught to, and what we feel is right, rather than what we feel is easy to attain short term success. We must stop and think about our journey in life. The points of life or nodes that we have visited and the lessons we have learned. We must constantly think about our deeper purpose and the meaning of our existence.

No comments:

Post a Comment