我正在尝试找到一种有效的算法来生成具有给定稀疏性的简单连通图.就像是:
Input:
N - size of generated graph
S - sparseness (numer of edges actually; from N-1 to N(N-1)/2)
Output:
simple connected graph G(v,e) with N vertices and S edges
Run Code Online (Sandbox Code Playgroud)