title: Pattern Matching in Python
body: <p>This question might go closer to pattern matching in image processing.</p>
  
  <p>Is there any way to get a cost function value, applied on different lists, which will return the inter-list proximity? For example,</p>
  
  <pre><code>a = [4, 7, 9]
  b = [5, 8, 10]
  c = [2, 3]
  </code></pre>
  
  <p>Now the cost function value for, may be a 2-tuple, (a, b) should be more than (a, c) and (b, c). This can be a huge computational task since there can be many more number of lists and all permutations would blow up the complexity of the problem. So only the set of 2-tuples would work as well.</p>
  
  <p>EDIT:
  The list names indicate the type of actions, and elements in them are the time at which corresponding actions occur. What I'm trying to do is to come up with set(s) of actions which have similar occurrence pattern. Since two actions cannot occur at the same time, it's the combination of intra- and inter-list distance.</p>
  
  <p>Thanks in advance!</p>