How to rank nodes on a graph?

6 次查看(过去 30 天)
BENEDETTO PIETRO Casu
移动Steven Lord 2023-10-11
Hello everybody! I am a newbie in Matlab and I have tried my way with the forum, guides, articles, etc., but I am not able to find what (I think) I need. So here is it: I have an undirected graph and I would like to select and use only some of its node, based on their rank. For instance, I have to run on it an algorithm to check its conductance, thus I need only the nodes with a selected centrality. Furthermore, my adiacency matrix changes every time I run the code, because it is the result of another code (I cannot name the nodes once and for all, unfortunately). I tried working with G.nodes syntax but I am not really great at it.
Can somebody help me? Thank you in advance!
Cheers,
Ben

回答(2 个)

ag
ag 2023-10-11
Hi Benedetto,
I understand that you need to assign ranks to the nodes present in your graph, and then use only those nodes which qualify the required ranking conditions.
To do so, you can use the “Custom attributes” functionality to add the attribute “ranks” to each node.
Please refer to the following documentation for more details:
https://www.mathworks.com/help/matlab/math/add-graph-node-names-edge-weights-and-other-attributes.html#AddGraphNodeNamesEdgeWeightsAndOtherAttributesExample-4
Hope this helps!
Best Regards,
Aryan Gupta

Christine Tobler
Christine Tobler 2023-10-11
移动:Steven Lord 2023-10-11
It depends what you mean by the rank of a node.
There are various centrality measures available through the centrality function on a graph. It seems sometimes the rank of a node is also measured in terms of its position in a search done on that graph, is this what you are looking for?

类别

Help CenterFile Exchange 中查找有关 Graph and Network Algorithms 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by