How to find the Laplacian of a Graph with multiple edges
4 views (last 30 days)
Show older comments
I'm using MATLAB online version 2018b. I'd like to ask for help in using the laplacian function in graph.
The adjacency(A) and degree(D) commands(doesn't work for multi graphs(multiple edges between two nodes) in version 2016b) work for the graph with multi edges. But, laplacian(Graph) isn't working.Is it a bug? Because, from what I understand, L=A-D. I get the following error,
Error using graph/laplacian (line 22)
Graph has multiple edges.
Code:
Input = [1,2;2,3;3,4;4,5;4,5;5,6;5,7];
tail = Input(:,1);
head = Input(:,2);
Graph = graph(tail,head)
plot(Graph)
A = full(adjacency(Graph))
D = degree(Graph)
L = full(laplacian(Graph))
0 Comments
Answers (1)
Walter Roberson
on 3 Dec 2018
no the documentation for laplacian says that the input cannot be a multigraph or contain self loops so there is no bug in the routine .
9 Comments
See Also
Categories
Find more on Graph and Network Algorithms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!