I am working on a project about scheduling and routing in networks. I have the objective to implement some routing and scheduling algorithms for different frames in some protocol.
My question is regarding the kind of inputs that the NetworkX library in Python can handle and how scalable it is. I looked at more examples but did not really encounter some similar input data as mine.
I have a small example of input from another project, which represents a topology example with nodes and links, here is the example data:
{
"graph": {},
"directed": true,
"multigraph": true,
"nodes": [
{"id": 0, "host": false, "MSD": 4},
{"id": 1, "host": false, "MSD": 4},
{"id": 2, "host": false, "MSD": 4},
{"id": 3, "host": false, "MSD": 4},
{"id": 4, "host": false, "MSD": 4},
{"id": 5, "host": false, "MSD": 4},
{"id": 6, "host": false, "MSD": 4},
{"id": 7, "host": false, "MSD": 4},
{"id": 8, "host": false, "MSD": 4},
{"id": 9, "host": false, "MSD": 4},
{"id": 10, "host": false, "MSD": 4},
{"id": 11, "host": false, "MSD": 4},
{"id": 12, "host": true, "MSD": 4},
{"id": 13, "host": true, "MSD": 4},
{"id": 14, "host": true, "MSD": 4},
{"id": 15, "host": true, "MSD": 4},
{"id": 16, "host": true, "MSD": 4},
{"id": 17, "host": true, "MSD": 4},
{"id": 18, "host": true, "MSD": 4},
{"id": 19, "host": true, "MSD": 4},
{"id": 20, "host": true, "MSD": 4},
{"id": 21, "host": true, "MSD": 4},
{"id": 22, "host": true, "MSD": 4},
{"id": 23, "host": true, "MSD": 4}
],
"links": [
{"source": 0, "target": 1, "key": 0, "id": "l0"},
{"source": 0, "target": 12, "key": 0, "id": "l1"},
{"source": 0, "target": 4, "key": 0, "id": "l2"},
{"source": 1, "target": 0, "key": 0, "id": "l3"},
{"source": 1, "target": 2, "key": 0, "id": "l4"},
{"source": 1, "target": 13, "key": 0, "id": "l5"},
{"source": 2, "target": 1, "key": 0, "id": "l6"},
{"source": 2, "target": 3, "key": 0, "id": "l7"},
{"source": 2, "target": 14, "key": 0, "id": "l8"},
{"source": 3, "target": 2, "key": 0, "id": "l9"},
{"source": 3, "target": 7, "key": 0, "id": "l10"},
{"source": 3, "target": 15, "key": 0, "id": "l11"},
{"source": 4, "target": 16, "key": 0, "id": "l12"},
{"source": 4, "target": 8, "key": 0, "id": "l13"},
{"source": 4, "target": 5, "key": 0, "id": "l14"},
{"source": 4, "target": 0, "key": 0, "id": "l15"},
{"source": 5, "target": 17, "key": 0, "id": "l16"},
]
}
The number of "ids" represents the number of nodes, the "host" variable shows if it is an end node or a switch in the network and finally the "links" show the connections between nodes.
- Q1: How easy is it to use this kind of data as an input to make graphs in NetworkX library?
- Q2: Performing algorithms with the following data is scalable?
- Q3: How easy is the integration of NetworkX with my own algorithm implementation?
If you have any other useful Python libraries feel free to share them.