Given:
dag1 = {"scst" \[DirectedEdge] "stel", "scst" \[DirectedEdge] "sfin",
"scst" \[DirectedEdge] "sbus", "scst" \[DirectedEdge] "swhl",
"scst" \[DirectedEdge] "ma6", "sfin" \[DirectedEdge] "stel",
"sfin" \[DirectedEdge] "sbus", "sfin" \[DirectedEdge] "swhl",
"sbus" \[DirectedEdge] "stel", "sbus" \[DirectedEdge] "ma6",
"swhl" \[DirectedEdge] "sbus", "swhl" \[DirectedEdge] "ma6"};
The following code intends to extract all the edges directed towards the vertex "sfin". However, it gives an empty set!
EdgeList[dag1, _ -> "sfin"]
Given a directed graph dag1
, I like to extract the set of vertices having directed edges towards vertex "sfin", such as
{"sfin", "scst"} for vertex "sfin"
{"bus", "stel", "ma6"} for vertex "sbus", etc.
Note that the vertex of interest is the first element in the above two example sets.