Play Journal Entries

Petit computer 3

きのpuchitai

10/19/2017 10:31 AM ·Spoilers

昔の感覚を思い出すために、格子上の道の通り方を数えるプログラムを組んでみました。4×4が限界だし論文とか読んでアルゴリズムを導入しないとダメかな···

Advertisement

Comment

This post has no comments.

  • 面白そうですね!! 条件は、全ての角・交差点をただ一度だけ通る?? 限界の理由は何ですか??

    Yeahs2
    Played
  • 同じ道なだけで、全部通らなくても大丈夫です! 10×10までは処理できるようにしているのですが、5×5の時の答えは4×4の150倍になるので待つと半日かかりそうなんですよね...

    Yeahs0
    Played
  • 同じ角・交差点を一度以上通ることなくSからGまで、ですね?? 限界は時間ですかー

    Yeahs0
    Played
  • まさしくその通りです。遠回りしてもいいけれど同じ角を通らないで左上から右下まで移動する方法...となります。 単純なのですが、マスが1つ大きくなると計算量が何千倍にも何万倍にもなってしまうんのでそれだけ時間がかかるんですよね..

    Yeahs0
    Played
  • PC で C でバックトラックで書いたけど 4x4(8512)で 0.00秒 5x5(1262816)で 0.65秒 6x6(575780564)で 389.02秒 でした。 これって組み合わせ爆発おねえさん問題ですね?? 賢いアルゴリズムがあるらしいけど???

    Yeahs0
    Played
  • まさしく「おねえさんの問題」ですね。ただの総当たりだと高々4^(n^2)通り調べないといけないので、こちらも簡単なバックトラック法で書かせていただきました あれから、おねえさんの問題のプロジェクトをされていた方の著書で、アルゴリズムの流れはおおよそ理解できましたが、プログラミングに不馴れで未だにそれを再現できておりません…

    Yeahs0
    Played

Add a Comment

You must sign in to post a comment.

Sign in using a Nintendo Network ID to connect to users around the world by writing posts and comments and by giving Yeahs to other people's posts. You can create a Nintendo Network ID using your Wii U console or your system in the Nintendo 3DS family.

Use of Miiverse Details about Miiverse

Report Violation to Miiverse Administrators

You are about to report a post with content which violates the Miiverse Code of Conduct. This report will be sent to Nintendo's Miiverse administrators and not to the creator of the post.

Violation Type:

Post ID: 3DB-NBL7-DPU-2NLA-HZK-4GUZ

Report Violation to Miiverse Administrators

You cannot report posts made automatically by a software title.

Edit Post

Select an action: