isSource -- determines if a vertex of a digraph is a source or not

Synopsis

• Usage:
r = isSource (D, v)
• Inputs:
• D, an instance of the type Digraph,
• v, , the vertex being texted
• Outputs:
• r, , whether the vertex v is a source or not

Description

A vertex v of a Digraph D is a source if v has no parents

 i1 : D = digraph({a,b,c,d,e},{{a,b},{b,c},{b,d},{e,b}}); i2 : isSource (D,c) o2 = false i3 : isSource (D,e) o3 = true