# descendants -- returns the descendants of a digraph

## Synopsis

• Usage:
L = descendants (D, v)
• Inputs:
• D, an instance of the type Digraph,
• v, , a vertex of the digraph
• Outputs:
• L, a set, a set of all the descendants of v

## Description

The descendants of a directed graph are all the vertexSet u of D such that u is reachable from v. Another way to more intuitively see what the descendants are is to see the descandants of a vertex v can be found by first taking the children of v. Then if you take the children of each of the children, and continue the process until the list stops growing, this will form all the descandants of v.

 i1 : D = digraph({a,b,c,d,e},{{a,b},{b,c},{b,d},{e,b}}); i2 : descendants (D, a) o2 = set {a, b, c, d} o2 : Set