TheAlgorithms / Python Public
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
Random graph generator hacktoberfest #5240
Random graph generator hacktoberfest #5240
Conversation
graphs/random_graph_generator.py
Outdated
| >>> random_graph(4, 1) | ||
| {0: [1, 2, 3], 1: [0, 2, 3], 2: [0, 1, 3], 3: [0, 1, 2]} | ||
| >>> random_graph(4, 1, True) | ||
| {0: [1, 2, 3], 1: [0, 2, 3], 2: [0, 1, 3], 3: [0, 1, 2]} | ||
| """ |
It would be cool if directed True and directed False did not generate exactly the same output.
@manueldilullo I just thought that these tests generate complete graphs - but we may also make it random: https://docs.python.org/3/library/random.html#random.seed. With it, directed-ness can also be (simutaneously) tested.
Oh, I didn't think about it. I couldn't find a solution for that problem by myself ahahah. I'm updating my code right now


Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.The text was updated successfully, but these errors were encountered: