how to convert the edge list (with node,node,weight) into weighted matrix

10 ビュー (過去 30 日間)
Zhuo Zhou
Zhuo Zhou 2019 年 3 月 6 日
回答済み: Pranjal Priyadarshi 2019 年 3 月 14 日
refer to the title

回答 (1 件)

Pranjal Priyadarshi
Pranjal Priyadarshi 2019 年 3 月 14 日
To convert an adjacency list into an adjacency matrix in MATLAB we can use the “adjacency” function available in the library.
A= adjacency(G,'weighted') returns a weighted adjacency matrix, where for each edge (i,j), the value A(i,j) contains the weight of the edge. If the graph has no edge weights, then A(i,j) is set to 1. For this syntax, G must be a simple graph such that ismultigraph(G) returns false.
For a detailed explanation along with examples you can use the following documents:
https://www.mathworks.com/help/matlab/ref/graph.adjacency.html

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by