Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] Convert sumolib.net.readnet Graph to Adjacency Matrix

Dear users,

I got a Graph using sumolib.net.readnet. 

But my problem is to get graph in the form of matrix like following :

graph = [[-1, 5, 7, 9, 2],
[5, -1, 12, 8, 6],
[7, 12, -1, 13, 21],
[9, 8, 13, -1, 9],
[2, 6, 21, 9, -1]]
Would you please help me with some code or something so that i can get this kind of graph?

Thanks in advance. Regards.
:)
Bijal Varia

Back to the top