Skip to content

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

@robsenbobsen

Description

@robsenbobsen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions