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

Multigraph discretization only shows the number of unique edges. #45

Open
robhta opened this issue May 15, 2024 · 0 comments
Open

Multigraph discretization only shows the number of unique edges. #45

robhta opened this issue May 15, 2024 · 0 comments

Comments

@robhta
Copy link

robhta commented May 15, 2024

Hello everyone,
first of all, thank you for your fantastic work!
I am currently using your library, and I was surprised that after discretizing my multigraph, I only ever got back roughly the number of unique edges.

With the following code change, I can create an equivalent edge count even after discretization.

Or did I use the library incorrectly?

Please contact me anytime with any questions, suggestions, or application tips.

        for edge in edges_list.items():
            if bin_ts not in updated_edgelist:
                updated_edgelist[bin_ts] = {edge[0]: edge[1]}
            else:
                if (not freq_weight):
                    updated_edgelist[bin_ts][edge[0]] = edge[1]
                else:
                    if (edge[0] in updated_edgelist[bin_ts]):
                        updated_edgelist[bin_ts][edge[0]] += edge[1]
                    else:
                        updated_edgelist[bin_ts][edge[0]] = edge[1]

https://github.com/ComplexData-MILA/TGX/blame/72b932f252264c75ccef278925619a6cbd504537/tgx/utils/graph_utils.py#L82-L92C59

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

No branches or pull requests

1 participant