Random Geometric Graphs, but fast
I am optimising the random geometric graph generation ideas in this post. I need to generate a large number of random geometric graphs with probabilistic connectivity (soft random geometric graphs),...
View ArticleAnswer by Henrik Schumacher for Random Geometric Graphs, but fast
CompiledFunctionTools`CompilePrint@edgescompiled tells me that the problem lies in Subsets not being compilable.Either you pass the subsets as arguments or you use something like this...
View ArticleAnswer by apg for Random Geometric Graphs, but fast
To expand on Hendrik Schumacher's answer, one can pass in the subsets as a list, as such:beta = 2;density = 5;r = 2;Ngraphs = 100;edgescompiled = Compile[{{subsets, _Real, 3}, {b, _Real}},...
View ArticleAnswer by Michael E2 for Random Geometric Graphs, but fast
There are two parts to this answer. The first leverages Mathematica's built-in vectorized functions for a order-of-magnitude gain in speed, when parallelized, over the OP's self-answer. The second...
View Article