Note: This page has been translated by MathWorks. Please click here

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

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

Connected graph components

`bins = conncomp(G)`

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

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.

Was this topic helpful?