Macaulay2 » Documentation
Packages » Graphs :: isStronglyConnected
next | previous | forward | backward | up | index | toc

# isStronglyConnected -- checks if a digraph is strongly connected

- Usage:
    `r = isStronglyConnected D`
- Inputs:
  - D, a digraph,
- Outputs:
  - r, a Boolean value,

## Description

A digraph is said to be strongly connected if for each vertex u of D, any other vertex of D is reachable from u. An equivalent definition is that D is strongly connected if the distance matrix of D has only positive terms in the non-diagonal entries.

    i1 : D = digraph({1,2,3,4},{{1,2},{2,3},{3,4},{4,2}});

    i2 : isStronglyConnected D

    o2 = false

    i3 : D' = digraph({1,2,3,4},{{1,2},{2,1},{2,3},{3,4},{4,2}});

    i4 : isStronglyConnected D'

    o4 = true

## See also

- isWeaklyConnected -- checks if a digraph is weakly connected
- distanceMatrix -- Computes the distance matrix of a digraph
- isReachable -- checks if a vertex u is reachable from a vertex v

## Ways to use isStronglyConnected:

- `isStronglyConnected(Digraph)`

## For the programmer

The object isStronglyConnected is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Graphs.m2:4701:0.