title: get degree of parent node in a graph igraph
body: <p>I have a graph and I would like to calculate for each node the degree of its parent nodes. </p>
  
  <p>Here is a figure as example, </p>
  
  <p><a href="https://i.stack.imgur.com/bmpqS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bmpqS.png" alt="enter image description here"></a></p>
  
  <p>In this example, the degree of node-9 would be 9, 5 connections from node-19 and 4 connections from node-3; and for node-5 it would be 3, since its parent node-13 has 3 connections.</p>
  
  <p>I want to calculate the degree starting for one node (for example node-19) and calculate the degree based on parents for nodes 2, and 3 steps away from node-19.</p>
  
  <p>I was thinking in using the function <code>ego</code> but it also gives me the parents of the parents in step 2, and 3.</p>
  
  <p>Any help?   </p>