matlab - How to determine a graph is totally connected? -
sorry simple question, there way determine graph totally connected? read papers indicate total connectedness of graph prerequisite of graph analysis. search through graph analysis toolboxes of matlab such function determines connectedness seems @ least none provided in these toolboxes. please give me suggestion on this? many thanks!
just make thread of answers complete . above steps:
assume have graph's matrix g
make diagonal matrix d same size g , put degree of nth node in nth diagonal element
make laplacian matrix : l = d - g
compute l's eigenvalues(eig function in matlab you)
the number of engenvalues equal 0 number of components in graph
if number of components 1 graph connected , otherwise has number of components wanted
this method works both directed , undirected graphs
hope find helpful
Comments
Post a Comment