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

Powerlaws #18

Closed
wants to merge 19 commits into from
Closed

Powerlaws #18

wants to merge 19 commits into from

Conversation

WillHWThompson
Copy link
Collaborator

A new branch for testing PS on configuration models.

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@@ -128,3 +123,31 @@ def clustered_unipartite(n_groups, n_ind, my_p_dist, my_g_dist, **kwargs):
B = bipartite_graph(edge_list)
U = nx.projected_graph(B, projected_nodes) # create unipartite projection
return nx.adjacency_matrix(U).todense()


def truncated_power_law_configuration(n, x_min, x_max, r, seed=None):
Copy link
Owner

Choose a reason for hiding this comment

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

I think because we're doing so much post-processing, we could probably just modify this algo a little bit.

G = nx.configuration_model(degree_sequence)
G = nx.Graph(G)
G.remove_edges_from(nx.selfloop_edges(G))
return G
Copy link
Owner

Choose a reason for hiding this comment

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

This should return a matrix.

@nwlandry nwlandry closed this Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants