Matlab code to compute the Kemeny-based centrality described in https://doi.org/10.1137/22M1486728
Usage:
- prepare (using QGis or some other tool) a file
somename.csv(where you can put any name of your choice instead ofsomename) with at least 4 columnsx1,y1,x2,y2, which identify the beginning / end of each road. - run in Matlab
G = kementrality('somename')
- a file
somename_kementrality.csvis created; this contains the smae columns assomename.csvplus one column namedkementrality, which contains the values of the measure. This column may contain NaN if some values could not be computed; this happens for instance if the network is disconnected or has self-loop edges (zero-length roads). - You may then re-import
somename-kementrality.csvinto QGis or your tool of choice. - Optionally, you may plot the result directly in Matlab with
plotmeasure(G, G.Edges.kementrality);
or interact with it; the function returns a Matlab Graph object, and coordinates G.Nodes.x, G.Nodes.y are added automatically.
For more detailed information, type into Matlab
doc kementrality