title: Graph branch decomposition
body: <p><img src="https://i.stack.imgur.com/riABJ.png" alt="enter image description here">
  Hello, </p>
  
  <p>I would like to know about an algorithm to produce a graph decomposition into branches with rank in the following way:</p>
  
  <pre><code>Rank | path (or tree branch)
  0      1-2
  1      2-3-4-5-6
  1      2-7
  2      7-8
  2      7-9
  </code></pre>
  
  <p>The node 1 would be the Root node and the nodes 6, 8 and 9 would be the end nodes.
  the rank of a branch should be given by the number of bifurcation nodes up to the root node. Let's assume that the graph has no loops (But I'd like to have no such constraint)</p>
  
  <p>I am electrical engineer, and perhaps this is a very standard problem, but so far I have only found the BFS algorithm to get the paths, and all the cut sets stuff. I also don't know if <a href="https://stackoverflow.com/questions/23737690/algorithm-for-generating-a-tree-decomposition">this</a> applies.</p>
  
  <p>I hope that my question is clear enough.</p>
  
  <p>PS: should this question be in stack overflow?</p>