Skip to content

Issue with remove_nodes method #40

@BinGnadenlos

Description

@BinGnadenlos

I've experienced an issue with the remove_node method from hypergraphx.core
the nodelist of my hypergraph is [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24];
the edgelist of my hypergraph is [(0, 1), (0, 1, 2), (1, 3), (1, 4), (2, 5), (3, 6), (5, 7), (7, 8), (8, 9), (2, 10), (1, 11), (0, 11), (4, 11), (1, 12), (7, 13), (7, 13, 14), (7, 14, 15), (13, 16), (2, 5, 7, 17), (15, 18), (7, 19), (15, 20), (13, 21), (1, 4, 22), (15, 20, 23), (0, 11, 24)].
when I run my code with the command ——H.remove_nodes([0, 1, 11], keep_edges=True), An error has occurred.
Traceback (most recent call last):
File "check_everything.py", line 446, in
H.remove_nodes([0, 1, 11], keep_edges=True)
File "hypergraphx/core/hypergraph.py", line 481, in remove_nodes
self.remove_node(node, keep_edges=keep_edges)
File "hypergraphx/core/hypergraph.py", line 455, in remove_node
self.remove_edges(to_remove)
File "hypergraphx/core/hypergraph.py", line 418, in remove_edges
self.remove_edge(edge)
File "hypergraphx/core/hypergraph.py", line 387, in remove_edge
raise KeyError("Edge {} not in hypergraph.".format(edge))
KeyError: 'Edge (11,) not in hypergraph.'
Please help me and check the remove_nodes method.

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