next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Graphs :: parents

parents -- Returns the parents of a vertex in a digraph

Synopsis

Description

This function takes as input a digraph and the name of the node of interest. It returns the set of the names for the vertices that are the parents of the node given.
i1 : D = digraph({{a, {b,c}}, {b,{d,e}}, {c, {e,h}}, {d, {f}}, {e, {f,g}},
         {f, {}}, {g, {}}, {h, {}}})

o1 = Digraph{a => set {b, c}}
             b => set {d, e}
             c => set {e, h}
             d => set {f}
             e => set {f, g}
             f => set {}
             g => set {}
             h => set {}

o1 : Digraph
i2 : pA = parents(D,e)

o2 = set {b, c}

o2 : Set

Ways to use parents :