# Create a graph with a
# directed tree
graph <-
create_graph() %>%
add_balanced_tree(
k = 2, h = 2)
# Inspect the graph's edges
graph %>% get_edges()
# Reverse the edge directions
# such that edges are directed
# toward the root of the tree
graph <-
graph %>%
rev_edge_dir()
# Inspect the graph's edges
# after their reversal
graph %>% get_edges()
Run the code above in your browser using DataLab