# Create a connected graph matrix:
adjacency_matrix <- matrix(
data = c(
0, 1, 0, 0, 1, 0,
1, 0, 1, 0, 1, 0,
0, 1, 0, 1, 0, 0,
0, 0, 1, 0, 1, 1,
1, 1, 0, 1, 0, 0,
0, 0, 0, 1, 0, 0
),
ncol = 6,
byrow = TRUE,
dimnames = list(
LETTERS[1:6],
LETTERS[1:6]
)
)
# Check graph is connectedPermute all ways to split graph (remove edges):
permute_graph_splits(adjacency_matrix = adjacency_matrix)
Run the code above in your browser using DataLab