Hello all,
Hope you are fine. I'm trying to generate random networks (using NetworkX.gnm_random_graph method) with an specific Diameter range, where initially I just get the value generated and using that as a basis I generate others random graphs by adding/removing edges so I can get a desired Diameter.
I got a way to decrease Diameter which works fine by just adding edges on the longests paths obtained in NetworkX.single_source_shortest_path, but I was not able to find a way to increase Diameter to a fixed number (or try to).
My goal is try to make graphs with different nodes number, density an diameter. where this last one is being an issue for me (without caring about density alteration on diameter value correction, nor nodes edges additions since they have no meaning)
Does anyone have an idea how I could archive this, regardless of algorithm complexity or execution time?
Thanks in advance
Francisco
PD: code I'm using to decrease Diameter attached below