Forgot password?
 Create new account
View 137|Reply 3

随机生成自避行走

[Copy link]

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

hbghlyj Posted at 2023-5-25 06:05:54 |Read mode
在$n\times n$网格如何随机生成自避行走
下面是基于对称的,不是随机生成的.

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2023-5-25 06:19:11

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2023-5-25 08:08:21

暴力尝试🥵

$type rand.asy (1.03 KB, Downloads: 32)
取$n=8$,随机种子s从s=1开始尝试,大多数都(走到死胡同了)不能产生哈密顿路.一直到s=26098才成功.

3148

Threads

8489

Posts

610K

Credits

Credits
66148
QQ

Show all posts

 Author| hbghlyj Posted at 2023-5-25 08:47:24
find改写(需要find四次,可能还不如4#的一遍循环快):
$type rand.asy (1.07 KB, Downloads: 36)

手机版Mobile version|Leisure Math Forum

2025-4-20 11:49 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list