Skip to content

RuntimeError: dictionary changed size during iteration #14

@n-tasnina

Description

@n-tasnina

In ksp_Astar.py, in the following for loop a dictionary object is being changed while iterating over it. Python 3 does not allow it.

for u,v, edata in net.in_edges(x, data=True):

Solution: Can save all the edges that need to be removed in a list inside the loop. Then just outside the loop, use the networkx function
remove_edges_from() to remove these edges from net.

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