antvis/G6

算法 - 环路检测(迁移升级) #4920

Yanyan-Wang posted onGitHub

Issue Hunt 计划(可选)

  • 我同意将这个 Issue 参与 Issue Hunt 计划

Issue 难度

中等难度

悬赏

请在 2023 年 9 月 30 日之前完成 PR,10 月 15 日之前完成全部 CR 意见的修改。 AntV 将支付 $15 (汇率按结算当日计)

问题描述

基于 @antv/algorithm 的 next 分支,将 master 分支的 cycle-dectect 进行迁移。需要注意:

  • 底层数据结构发生了变更,之前是 JSON 数据作为输入,现在使用 graphlib 数据结构,例如已迁移完成的 dijkstra
  • 输出结构可与旧版保持一致,也可根据合理性重新设计,重新设计需在提交 PR 时评论写明原因
  • graphlib 提供了类似 getDegree,getNeighbor 等基础 API,因此不再需要旧版 algorithm 中 util 的这些相关方法。graphlib 的 getDegree 使用例子
  • 算法实现后,需要在 tests 文件夹中编写测试用例,参考 findPath 的测试用例
  • 请用英文将注释写完整,包括各函数的含义、入参、出参含义。可借助 GPT 老师~

🌸 !!由于 rust 版本算法的难度比较高,我们不确定是否有贡献者愿意完成。如果你对 Rust / 学习 Rust 感兴趣,请在 Issue Hunter 群中联系十吾,我们可以另启高额的悬赏令~

重现链接

https://github.com/antvis/algorithm/blob/next/packages/graph/src/dijkstra.ts

重现步骤

  1. clone @antv/algorithm 代码
git clone https://github.com/antvis/algorithm.git
  1. 拉取所有线上分支
git fetch
  1. 切换到 next 分支
git checkout next
  1. 进入 graph 包
cd packages/graph
  1. 安装依赖
npm install
  1. 实现功能、新增测试

测试 位于 /tests

测试用例的编写以及测试方式参考:https://github.com/antvis/algorithm/blob/next/__tests__/unit/findPath.spec.ts

  1. 提交代码,等待 CR

  2. 根据(多次) CR 建议修改

  3. 等待合并入 v5 分支后,管理员支付奖金

预期行为

算法按预期运行,并充分考虑边界情况。注释、测试完整。提交的 PR 应当包括效果截图。

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]
  • G6 版本: [5.0-beta]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


请复制以下模板,填写相关信息,然后删除模板中的注释。 Please copy the following template, fill in the relevant information, and then delete the comments in the template.


## Issue 认领 / Issue Claim

**贡献者/Contributor**

> 例如:张三, 李四
> For example: John Smith, Sarah Johnson

**预计完成时间/Estimated Completion Date**

> 例如:2023-06-06
> For example: May 30, 2023

**联系方式/Contact Information**

> 例如:contact@email.com
> For example: contact@email.com

**其他信息/Additional Information**

> 例如:这个 issue 比预期的要复杂,我希望能获得更多的奖励
> For example: This issue is more complex than expected, and I hope to receive more reward.
posted by github-actions[bot] over 1 year ago

Issue 认领 / Issue Claim

贡献者/Contributor

zqqcee

预计完成时间/Estimated Completion Date

2023-09-18

联系方式/Contact Information

例如:zqqcee@163.com

其他信息/Additional Information

posted by zqqcee over 1 year ago

已完成并转账

posted by Yanyan-Wang over 1 year ago

Fund this Issue

$0.00
Funded

Pull requests