title: Number of Paths in a Graph
body: <p>I have an undirected, unweighted graph. Let us fix a vertex and find all distinct paths from that vertex which covers all vertices of the graph. The task is to find the number of possible such paths from every vertices. <br/>
   Eg: Let us take a graph of <strong>4 vertices</strong> <code>[ 1, 2, 3, 4]</code>. And the <strong>edges</strong> are (1,2), (2,3), (3,4), (4,2). Here <strong>answer</strong> is <strong>4</strong>. The paths are <code>1&gt;2&gt;3&gt;4</code>, <code>1&gt;2&gt;4&gt;3</code>, <code>3&gt;4&gt;2&gt;1</code>, <code>4&gt;3&gt;2&gt;1</code>.</p>
  
  <hr>
  
  <p>I have come with an algorithm which uses brute-force technique to find the number of possible such paths, initialized by each vertex.<br/>Eg:
  For the above example: <br/>
  <code>From vertex 1 there is 2 such path;</code> <br/>
  <code>From vertex 2 there is no such path;</code> <br/>
  <code>From vertex 3 there is 1 such path;</code> <br/>
  <code>From vertex 4 there is 1 such path;</code> <br/>
  So the <strong>answer</strong> is <strong>2+1+1=4</strong>.</p>
  
  <hr>
  
  <p>Is it possible to solve this problem in a better <em>time complexity?</em></p>