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

fix(Graph): DAG/connected 函数中计算边数上限的错误 #176

Open
weilycoder opened this issue Mar 20, 2025 · 1 comment
Open

fix(Graph): DAG/connected 函数中计算边数上限的错误 #176

weilycoder opened this issue Mar 20, 2025 · 1 comment

Comments

@weilycoder
Copy link
Contributor

语句cyaron.Graph.DAG(10, 90, repeated_edges=False) 将导致无限循环。

cyaron/cyaron/graph.py

Lines 609 to 615 in 0865426

if not repeated_edges:
max_edge = Graph._calc_max_edge(point_count, not loop, self_loop)
if edge_count > max_edge:
raise Exception(
"the number of edges of this kind of graph which has %d vertexes must be less than or equal to %d."
% (point_count, max_edge))

应把 610 行的 not loop 换成 loop

@weilycoder
Copy link
Contributor Author

weilycoder commented Mar 20, 2025

@Mr-Python-in-China 你直接修了吧

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

No branches or pull requests

1 participant