get_articulation_points {DiagrammeR} | R Documentation

## Get articulation points

### Description

Get the nodes in the graph that are identified as articulation points.

### Usage

    get_articulation_points(graph)

### Arguments

`graph` | a graph object of class `dgr_graph`.

### Value

a vector of node IDs.

### Examples

    # Create a random graph and make every node
    # shape a `square`
    graph <-
      create_random_graph(
        n = 30, m = 50,
        set_seed = 23) %>%
      set_node_attrs(
        node_attr = "shape",
        values = "square")

    # Get the articulation points in the graph (i.e.,
    # those nodes that if any were to be removed, the
    # graph would become disconnected)
    get_articulation_points(graph)
    #> [1]  9 10 12 19 22 26 30

    # For the articulation points, change the node
    # shape to a `circle`
    graph <-
      graph %>%
      select_nodes_by_id(
        nodes = get_articulation_points(.)) %>%
      set_node_attrs_ws(
        node_attr = "shape",
        value = "circle")

[Package DiagrammeR version 0.9.2 Index]