Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Connected graph components

`bins = conncomp(G)`

`bins = conncomp(G,Name,Value)`

`[bins,binsizes] = conncomp(___)`

returns the connected components of
graph `bins`

= conncomp(`G`

)`G`

as bins. The bin numbers indicate which component each
node in the graph belongs to.

If

`G`

is an undirected graph, then two nodes belong to the same component if there is a path connecting them.If

`G`

is a directed graph, then two nodes belong to the same strong component only if there is a path connecting them in both directions.

uses additional options specified by one or more Name-Value pair arguments. For
example, `bins`

= conncomp(`G`

,`Name,Value`

)`conncomp(G,'OutputForm','cell')`

returns a cell array to
describe the connected components.