This should detect the index of the master node by finding the only node that only has incoming connections and no outgoing connections.
One issue is that it is currently possible for there to be multiple Nodes with no outgoing connections - we might be able to fix this by tightening the method for adding nodes i.e. we could force a user to only be able to add Nodes as long as they connect to some pre-existing node within the graph. This might be too restrictive to be worth it though.
This should detect the index of the master node by finding the only node that only has incoming connections and no outgoing connections.
One issue is that it is currently possible for there to be multiple Nodes with no outgoing connections - we might be able to fix this by tightening the method for adding nodes i.e. we could force a user to only be able to add
Node
s as long as they connect to some pre-existing node within the graph. This might be too restrictive to be worth it though.