Using Entity Reference field, get the parent NID in referenced entity (node)
With the logical structure that is mentioned, it is possible that a node may have more than one parent. Wouldn't it be wiser to make a reference upwards than downwards? You would end up with an entityreference field of granularity 1. Unless there is some other reason for which to keep this structure.

There is no explanation on the specifics of this calculation that takes place. Is it in a custom module, is it rules, is it some other contrib module?

In any case, you can use an EntityFieldQuery in order to get a list of all nodes that reference the particular node. More details about how to use here. There is a particular reference for entityreference fields:


  Likewise an image field would use 'fid', 'alt', and 'title' as column names; an entity reference field would use 'target_id' and 'target_type' as column names.


Example (in CAPS the variables that you need to handle):

&lt;?php
$query = new EntityFieldQuery();
$query-&gt;entityCondition('entity_type', 'node')
  -&gt;entityCondition('bundle', 'MY_CONTENT_TYPE')
  -&gt;propertyCondition('status', 1) // published? yes
  -&gt;fieldCondition('field_MY_ENTITYREFERENCE', 'target_id', $MY_CURRENT_NODE_ID)
  -&gt;range(0, 10); //do not forget the semicolon at the end of the query conditions
$result = $query-&gt;execute();
if (isset($result['node'])) {
  $items_nids = array_keys($result['node']);
  $items = entity_load('node', $items_nids);
}
?&gt;