`posets/text/strongcomps` := TEXT(
`   `,
`FUNCTION:  strongcomps - strongly connected components of a digraph`,
`   `,
`CALLING SEQUENCE:  strongcomps(G);    strongcomps(G,'Q');`,
`                   strongcomps(G,X);  strongcomps(G,X,'Q');`,
`                   strongcomps(G,n);  strongcomps(G,n,'Q');`,
`   `,
`PARAMETERS:  G = the edge set of a directed graph`,
`             X = a set (the vertex set of G)`,
`             n = a positive integer (the number of vertices)`,
`             Q = a name (optional)`,
`   `,
`SYNOPSIS:`,
`  If G is a directed graph with vertex set X, strongcomps(G,X) returns`,
`  a list of sets that partition X into strongly connected components.`,
`  Two vertices x and y belong to the same strongly connected component if`,
`  and only if there is a directed path in G from x to y and y to x.`,
`   `,
`  The components are listed in an order consistent with G: if there is`,
`  an edge [x,y] in which x belongs to the i-th component and y belongs to`,
`  the j-th component, then i <= j (as integers).`,
`   `,
`  strongcomps(G,n) does the same, if the vertex set of G is {1,...,n}.`,
`  strongcomps(G) does the same, assuming that G has no isolated vertices.`,
`   `,
`  Optionally, if the last argument is an unassigned name, such as Q, then`,
`  in addition to returning a list of strongly connected components of G,`,
`  the procedure assigns to Q the edge set of the acyclic directed graph`,
`  induced by G on the components: [i,j] is an edge in Q if i<>j and there`,
`  is an edge [x,y] of G such that x belongs to the i-th component and y`,
`  belongs to the j-th component.`,
`   `,
`  Use 'covers' to extract the covering relation of the poset Q generates.`,
`   `,
`EXAMPLES:`,
`  G:={[a,b],[b,c],[c,a],[0,a],[c,1]};`,
`  strongcomps(G,'Q'),Q;            yields   [{0},{a,b,c},{1}], {[1,2],[2,3]}`,
`  P:=J({},3); P:={op(P),[8,3],[2,1]};`,
`  strongcomps(P);                  yields          [{1,2},{5},{6},{3,4,7,8}]`,
`  strongcomps(P,9,'Q');            yields      [{9},{1,2},{5},{6},{3,4,7,8}]`,
`  covers(Q);                       yields                {[2,3],[3,4],[4,5]}`,
` `,
`SEE ALSO:  connected, covers`,
NULL):

if `+`(0)=0 then # Maple V.4 or later
  print(INTERFACE_HELP(insert, topic=`posets/strongcomps`,
  helpfile=HomeLib, text=`posets/text/strongcomps`))
elif ceil(0)=0 then # Maple V.2 or V.3
  `help/posets/text/strongcomps`:=`posets/text/strongcomps`:
  save `help/posets/text/strongcomps`, cat(HomeLib,`/help/posets/text/strongcomps.m`)
fi:
