Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bernoulli random graph #200

Open
wants to merge 50 commits into
base: master
Choose a base branch
from

Conversation

aurorarossi
Copy link
Member

With this PR I add the Bernoulli random graph and the $\rho$-correlated Bernoulli random graphs generators.

@codecov
Copy link

codecov bot commented Dec 13, 2022

Codecov Report

Merging #200 (64fc9ec) into master (34743a5) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

❗ Current head 64fc9ec differs from pull request most recent head 1d326cb. Consider uploading reports for the commit 1d326cb to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #200      +/-   ##
==========================================
- Coverage   97.28%   97.24%   -0.05%     
==========================================
  Files         115      114       -1     
  Lines        6789     6610     -179     
==========================================
- Hits         6605     6428     -177     
+ Misses        184      182       -2     

@gdalle gdalle added the enhancement New feature or request label Jun 16, 2023
@aurorarossi
Copy link
Member Author

Great! have you also thought about some functions for the directed case?

I have just implemented the generator described in this paper , I have no knowledge of a directed case.

src/SimpleGraphs/generators/randgraphs.jl Outdated Show resolved Hide resolved
src/Graphs.jl Outdated Show resolved Hide resolved
test/runtests.jl Outdated Show resolved Hide resolved
g2_adj = adjacency_matrix(g2)
@test g1_adj == g2_adj
@test diag(g1_adj) == diag(g2_adj) == zeros(n)
ρ = 0.5 # non isomorphism case
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we do a probabilistic test on the correlation with ample error margins?

@gdalle
Copy link
Member

gdalle commented Feb 21, 2024

@aurorarossi is this good to go?

@gdalle
Copy link
Member

gdalle commented Mar 5, 2024

Side note, this might be linked to #212

Copy link
Member

@gdalle gdalle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good but it still needs tests that the probability of an edge is approximately p, and that the correlation between (nondiagonal?) adjacency matrices is approximately \rho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants