title: Finding Subgraph in a Graph
body: <p>I have a graph shown here. Just to node that nodes B_0, B_1, belong to node of type B, C_0, C_1. C_2, C_3 belong to node of type C and so on. 
  Now, I want to find multiple subgraphs, which could satify criteria like defined by this example - </p>
  
  <p>Criteria - </p>
  
  <ol>
  <li>subgraph contains 1 node of type A, 1 node of type B, 1 node of type C, one node of type D.</li>
  <li>subgraph has one edge from node of type A to one node of type B, one edge connecting type B and type C and one node connecting type C and type D.</li>
  <li>subgraph contains one edge from type A going out of subgraph to type B node, one edge
  from type B to type C node outside, one edge from type D to type E outside.</li>
  </ol>
  
  <p>Now this description should give result as - </p>
  
  <ol>
  <li>subgraph :: A_0, B_0, C_1, D_1</li>
  <li>subgraph :: A_0, B_0, C_0, D_0</li>
  <li>subgraph :: A_0, B_1, C_2, D_2</li>
  <li>subgraph :: A_0, B_1, C_3, D_3</li>
  </ol>
  
  <p>I want to know, if there is any algorithm, by which I can find such sub-graphs?
  I tried to figure out an algorithm by making all possible combinations. However, this would be exponential to number of nodes in subgraph. Thus, I want to know if there exists an efficient way to calculate it. Or if there exists a problem of similar nature in Graph Theory?</p>
  
  <p><img src="https://i.stack.imgur.com/VxCIa.jpg" alt="Graph"></p>