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: 禁止重边和自环时程序卡死 #95

Closed
WillHouMoe opened this issue Jul 28, 2022 · 4 comments · Fixed by #129
Closed

Bug: 禁止重边和自环时程序卡死 #95

WillHouMoe opened this issue Jul 28, 2022 · 4 comments · Fixed by #129

Comments

@WillHouMoe
Copy link

当我想造一个简单无向图时,程序会先生成几组数据,然后停住,不知道是什么原因。

报错:
image

生成文件:
image
image

代码:

from cyaron import *

_n = ati([0, 10, 50, 100, 500, 1E3])
_m = ati([0, 30, 500, 1E3, 1E4, 1E6])
_times = ati([0, 5, 5, 5, 10, 10])
_cnt = 1

for i in range(1, 6):
    n = _n[i]
    m = _m[i]
    for j in range(1, _times[i] + 1):
        test_data = IO(file_prefix="short", data_id=_cnt)
        _cnt += 1
        in_n = randint(1, n)
        in_m = randint(1, m)
        s = randint(1, in_n)
        t = randint(1, in_n)
        test_data.input_writeln(in_n, in_m)
        graph = Graph.graph(in_n, in_m, weight_limit=(1, 10000000), self_loop=False, repeated_edges=False)
        test_data.input_writeln(graph)
        test_data.input_writeln(s, t)
        test_data.output_gen("E:\\***\\std.exe")
@xiaoyiming123
Copy link

出现了什么异常?

@xiaoyiming123
Copy link

Traceback 前面的那个东西。

@xiaoyiming123
Copy link

例如 RuntimeError

@weilycoder
Copy link
Contributor

weilycoder commented Sep 30, 2024

显然因为边数太多导致无法生成,然后程序没有这方面的判断,所以一直尝试生成,然后就跑不完(在改了)。

报错信息没截全,但那段代码看起来不像能报错,怀疑是你 Ctrl+C 结束程序导致的。

#86

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 a pull request may close this issue.

3 participants