Generating the laplacian for a sub-graph that still reflects the connectivity of the overall graph
2 vues (au cours des 30 derniers jours)
Generating a sub-graph I think by convention breaks all edges between the sub-graph and the rest of the graph. Is it possible to include the edges with the rest of the graph in the resulting laplacian? In other words, the sub-graph will still consist of the subset of nodes that you want. How do you do this?
Steven Lord le 1 Nov 2022
Your comment refers to "the first figure" but no figures are attached to this post nor are there any linked documents including figures. But what I think you want to do is just to take a submatrix portion of the Laplacian of the whole graph.
A = sprand(10, 10, 0.2);
A = (A+A')/2;
G = graph(A, string(1:10), 'omitselfloops');
So if we took the subgraph that consists of nodes 1, 2, 8, 9, and 10:
nodes = [1 2 8 9 10];
S = subgraph(G, nodes);
Would you want what's in the variable named expected below instead of the variable Lsub? [Note I've intentionally converted the Laplacians to full from sparse to make them a little easier to read.] If not then for this particular pair of graphs G and S, what would you expect to receive?
Lfull = full(laplacian(G))
Lsub = full(laplacian(S))
expected = Lfull(nodes, nodes)