Skip to content

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

@weilycoder

Description

@weilycoder

语句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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions