# isConnected(Poset) -- determines if a poset is connected

## Synopsis

• Function: isConnected
• Usage:
i = isConnected P
• Inputs:
• P, an instance of the type Poset,
• Outputs:
• i, , whether $P$ is connected

## Description

The poset $P$ is connected if the number of connectedComponents is $1$. Equivalently, the poset $P$ is connected if between every pair of vertices in $P$ there exists a chain of relations going from one to the other.

The divisorPoset of $n$ is always connected.

 i1 : isConnected divisorPoset 18 o1 = true

The disjoint union of any two posets on disjoint vertex sets is disconnected.

 i2 : C = chain 3; i3 : P = sum(5, i -> naturalLabeling(C, 10*i)); i4 : isConnected P o4 = false