Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Prims algorithm for sparse graphs needs some more elaboration #1426

Open
@notimeforcaution

Description

@notimeforcaution

Link:https://cp-algorithms.com/graph/mst_prim.html#sparse-graphs-om-log-n

Edge in all the other places across document contains the weight and the already-selected node to which it is directed towards. For example: Thei element invector<Edge> min_e(N) implies that the smallest cost with which it can be connected to an already-selected node is 'w' and that already-selected node is 'to'.

However, in the implementation for sparse graphs, theset<Edge> contains all edges which connect selected to not-selected nodes, where 'to' now contains a node which is not already selected.

Implying at one place theto inEdge refers to selected nodes, whereas in other places it refers to non-selected nodes. While the algorithm still works best, but I think this bit can be clarified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp