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

bug in depth-first searching #6552

Closed
jasongrout opened this issue Jul 18, 2009 · 10 comments
Closed

bug in depth-first searching #6552

jasongrout opened this issue Jul 18, 2009 · 10 comments

Comments

@jasongrout
Copy link
Member

Here is a bug in the depth-first searching of a graph:


sage: D = DiGraph( { 0: [1,2,3], 1: [4,5], 2: [5], 3: [6], 5: [7], 6: [7], 7: [0]})
sage: list(D.depth_first_search(0, ignore_direction=True))                         
[0, 7, 6, 5, 3, 2, 1, 4]

It should be [0, 7, 6, 3, 5, 2, 1, 4].

CC: @rlmill

Component: graph theory

Author: Jason Grout

Reviewer: Robert Miller

Merged: Sage 4.1.1.alpha1

Issue created by migration from https://trac.sagemath.org/ticket/6552

@jasongrout
Copy link
Member Author

comment:1

I also added a bunch of features to the graph traversal functions and put in a lot more doctests.

@jasongrout
Copy link
Member Author

Author: Jason Grout

@rlmill
Copy link
Mannequin

rlmill mannequin commented Jul 18, 2009

comment:3

I say you remove the

#        for v,d in queue: 
#            seen.add(v) 

in depth_first_search and everything looks good!

@rlmill
Copy link
Mannequin

rlmill mannequin commented Jul 18, 2009

Reviewer: Robert Miller

@jasongrout
Copy link
Member Author

Attachment: trac-6552-graph-traversal.patch.gz

@jasongrout
Copy link
Member Author

comment:4

Good catch! I deleted those two lines and posted an updated patch. Thanks for reviewing this so fast!

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jul 20, 2009

Merged: sage-4.1.1.alpha0

@sagetrac-mvngu sagetrac-mvngu mannequin closed this as completed Jul 20, 2009
@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jul 20, 2009

comment:7

This will have to wait for Sage 4.1.1.alpha1. Apparently, I accidentally closed this as being merged in 4.1.1.alpha0.

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jul 20, 2009

Changed merged from sage-4.1.1.alpha0 to none

@sagetrac-mvngu sagetrac-mvngu mannequin reopened this Jul 20, 2009
@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jul 23, 2009

Merged: Sage 4.1.1.alpha1

@sagetrac-mvngu sagetrac-mvngu mannequin closed this as completed Jul 23, 2009
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant