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

DeleteEdge: remove tail from parent list of head vertex #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

svrana
Copy link

@svrana svrana commented Jun 11, 2019

Makes DeleteEdge the inverse of AddEdge

Description

AddEdge updates the children and parents set of the head and tail vertex, while DeleteEdge only removes the edge from the children of the tail vertex. This makes it difficult to use DeleteEdge as it does not fully remove the edge from the dag. In order to implement a topological sort, I needed to first implement my own DeleteEdge which shouldn't be necessary.

Approach

Fix the glitch by updating the parent list of the headVertex.

I followed the existing code in DeleteEdge that searches the entire set before calling remove(), but this is redundant as OrderedSet will repeat the same operation afaict. I can adjust that if desired.

Makes DeleteEdge the inverse of AddEdge.
@Druid33
Copy link

Druid33 commented Aug 31, 2021

Hi,

i see this PR wait over 2 years to merge. Is this package still supported or not?
I used it in one project and found bug on removing Vertex. I thing about make bugfix, but if package is dead, its useless.

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.

None yet

2 participants