DiagrammeR (version 1.0.0)

is_graph_connected: Is the graph a connected graph?

Description

Determines whether a graph is a connected graph.

Usage

is_graph_connected(graph)

Arguments

graph

a graph object of class dgr_graph.

Value

a logical value.

Examples

Run this code
# NOT RUN {
# Create a random graph using the
# `add_gnm_graph()` function; this
# graph is not connected
create_graph() %>%
  add_gnm_graph(
    n = 15,
    m = 10,
    set_seed = 23) %>%
  is_graph_connected()

# Create another random graph;
# this graph is connected
create_graph() %>%
  add_gnm_graph(
    n = 10,
    m = 15,
    set_seed = 23) %>%
  is_graph_connected()
# }

Run the code above in your browser using DataCamp Workspace