Skip to main content

Districts of a mixed graph

Source: R/queries.R, R/jlbind-wrappers.R

Description

Returns the districts (c-components) of cg: the connected components of its bidirected part, i.e. the sets of nodes joined by paths of <-> edges. A node with no bidirected edges is a district of its own.

Usage

Arguments

cg An ADMG or AG-family (AG, MAG) graph created with cgraph().

Value

A list of sorted character vectors, one per district.

Examples

admg <- cgraph(A %<->% B, B %<->% C, C %-->% D, class = "ADMG")
districts(admg)
#> [[1]]
#> [1] "A" "B" "C"
#> 
#> [[2]]
#> [1] "D"