Skip to content

Conversation

@fjzzq2002
Copy link
Contributor

Rt.

@lin-toto
Copy link
Member

lin-toto commented May 1, 2017

我刚才看你上一个pr的iterate_edges方法,为什么要end>=start才yield?感觉这是一个bug,有向图加边又不会加两次,而且万一我就是要5到1那不就坏了

@fjzzq2002
Copy link
Contributor Author

不是bug... or self.directed

@fjzzq2002
Copy link
Contributor Author

有向边是一定会yield的,无向边因为加两次所以只返回一次

@lin-toto
Copy link
Member

lin-toto commented May 1, 2017

好像是这样没错
我傻了
我merge啊

@fjzzq2002
Copy link
Contributor Author

等下啊我再看看

@lin-toto
Copy link
Member

lin-toto commented May 1, 2017

等一下,那还有一个问题,自环不就yield两次了?
其实我觉得这个里面根本没必要分什么有向图无向图了

@fjzzq2002
Copy link
Contributor Author

自环没有yield两次,详见add_edge

@lin-toto
Copy link
Member

lin-toto commented May 1, 2017

唔 不过在这里有什么可能需要把无向图分开处理的地方吗
这个昨天我写的时候也没想明白,现在感觉好像没什么用

@fjzzq2002
Copy link
Contributor Author

shuffle的时候有用吧...其他意义不大,..

@lin-toto lin-toto merged commit 8d8f261 into luogu-dev:master May 1, 2017
kkksc03 pushed a commit that referenced this pull request Feb 19, 2021
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.

2 participants