I am doing a program in C on graph theory. So I need an idea with which i can generate random graphs which are mostly highly disconnected. Can anyone give me any idea please?
I am doing a program in C on graph theory. So I need an idea with which i can generate random graphs which are mostly highly disconnected. Can anyone give me any idea please?
Create N nodes and log2(N) paths between random pairs of nodes.
Eg, if N = 256, then log2(N) will be 8 (that's going to be pretty well disconnected).
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Oh thanks! Nice idea let me try! Will ask here if I get struck! Thanks a lot!
Create N nodes and 0 edges. That's the most disconnected you can get.