sinks -- returns the sinks of a digraph

Synopsis

• Usage:
L = sinks D
• Inputs:
• D, an instance of the type Digraph, digraph whose sinks we are searching for
• Outputs:
• L, a list, list of all the sinks (if there are any)

Description

A sink of a Digraph D is a vertex of D that has no children. That is, v is a sink of D if and only if there are only edges pointing into v; none can be pointing out (there is no edge of the form (v,u)).

 i1 : D = digraph({a,b,c,d,e},{{a,b},{b,c},{b,d},{e,b}}); i2 : sinks D o2 = {c, d} o2 : List

• sources -- returns the sources of a digraph
• isSink -- determines if a vertex of a digraph is a sink or not

Ways to use sinks :

• "sinks(Digraph)"

For the programmer

The object sinks is .