Using Networkx to generate a connected graph from an existing list.
Requires:
-
Graph generated must connected but it is not required to be fully connected.
-
The graph must be generated from the existing list.
-
It is better to use existing networkx functions.
Examples with pictures
[9, 5, 7, 4, 2, 0, 8, 4, 0, 0, 0, 0] is the list I have used to generate graphs, and it is required to be able to select the nodes according to the given length Generate graph
There is only one requirement for adding edges: the generated graph must be a connected graph
Aucun commentaire:
Enregistrer un commentaire