The following code
does not give me an answer. It looks all is working when each command inside Module
is individually run. But as a Module
, it does not.
Can you tell me what is wrong with my formulation?
SeedRandom[02];
Gr = RandomGraph[{6, 10}, DirectedEdges -> True, VertexLabels -> "Name"];
sourceANDsinkF[G_, s_, t_] := Module[{e, source, sink},
e = DeleteDuplicates[EdgeList[G]];
source = Cases[e, s \[DirectedEdge] _];
sink = Cases[e, _ \[DirectedEdge] t]];
sourceANDsinkF[Gr, 1, 2]
for example. $\endgroup$ – Tugrul Temel Oct 13 '18 at 12:27