How to rank nodes on a graph?

6 views (last 30 days)
BENEDETTO PIETRO Casu
BENEDETTO PIETRO Casu on 11 Nov 2021
Moved: Steven Lord on 11 Oct 2023
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

Answers (2)

ag
ag on 11 Oct 2023
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 on 11 Oct 2023
Moved: Steven Lord on 11 Oct 2023
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?

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!