I have the following graph
my %connections=(36=>[31,22],31=>[30],30=>[20],22=>[20,8],20=>[1],8=>[5],5=>[2],2=>[1,20]);
Is there any existing algorithm that let us find node with only outgoing edges and only incoming edges. Hence given the above graph, it would yield:
$node_only_incoming_edge = [36];
$node_only_outgoing_edge = [1];
graph created using graph.gafol.net
Update: Fixed the %connection
entry error according to RF suggestion.