-
Notifications
You must be signed in to change notification settings - Fork 23
feat: algorithm MST(Minimum Spanning Tree) #72
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
Conversation
packages/graph/src/utils.ts
Outdated
| }; | ||
|
|
||
| /** | ||
| * 获取指定节点的边,包括出边和入边 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注释改一下~
packages/graph/src/utils.ts
Outdated
| * @param edges 图中的所有边数据 | ||
| */ | ||
| export const getEdgesByNodeId = (nodeId: NodeID, edges: Edge<{ [key: string]: any }>[]): Edge<{ [key: string]: any }>[] => { | ||
| return edges.filter((edge) => edge.source === nodeId || edge.target === nodeId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不过 graphlib 的 graph 应该有一个 API 叫 getRelatedEdges,应该能干这个函数的事儿?
| @@ -0,0 +1,46 @@ | |||
| /** | |||
| * 并查集 Disjoint set to support quick union | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
英文注释~
| } | ||
| } | ||
|
|
||
| // whether a and b are connected, i.e. a and b have the same root |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
把之前不规范的函数注释也顺便改改~
No description provided.