On Wednesday, March 19, 2014 5:19:36 PM UTC-4, kcrisman wrote: > > > >> Can you try using the "neighbors" keyword with something? >> >> sage: list(G.breadth_first_search(0,neighbors=lambda x: >> sorted(G.neighbors(x)))) >> [0, 8, 11, 19, 1, 12, 16, 2, 5, 9, 4, 15, 14, 18, 7, 6, 10, 13, 17, 3] >> > > Except that's not right, because it lists them all. I tried putting [0] > in some logical places but it didn't seem to work right away - but I bet > this will give you a good start for a final solution! > >> >> Sorry for having to use the lambda function. I'm not sure there is a >> better way to do it. >> > Aargh, and
sage: list(G.breadth_first_search(0,neighbors=lambda x: [sorted(G.neighbors(x))[0]] )) [0, 8] -- You received this message because you are subscribed to the Google Groups "sage-edu" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-edu+unsubscr...@googlegroups.com. To post to this group, send email to sage-edu@googlegroups.com. Visit this group at http://groups.google.com/group/sage-edu. For more options, visit https://groups.google.com/d/optout.