-2

unfortunately this is my second time I post this question because I did not receive an answer in the first place. Googling it the past few days, did not help me so I hope, that this time, someone can help me.

I have to calculate the vertex connectivity between two given vertices in R. The dataset is an adjacency matrix with 180 columns and rows and I want to calculate the connectivity between 4 defined vertex pairs.

Any ideas how to do it?

Thank you in advance!

1 Answers1

1

I have no clue about your desired output, but here are some ideas about components that may help

> set.seed(1)
> adjm <- matrix(sample(0:1, 100, replace = TRUE, prob = c(0.9, 0.1)), nc = 10)
> g <- graph_from_adjacency_matrix(adjm)
> components(g)$no
# [1] 5

where

  • adjm is assumed as the adjacency matrix
  • graph_from_adjacency_matrix yields the graph object regarding adjm
  • components gives information in terms of connected sub-graphs, and $no gives the number of clusters

enter image description here

ThomasIsCoding
  • 96,636
  • 9
  • 24
  • 81