alexcrawford / lexorank-php
PHP 实现了 JIRA 的 LexoRank 算法。
2.0.0
2022-10-07 14:26 UTC
Requires
- php: ~8.0 || ~8.1 || ~8.2
- webmozart/assert: ^1.11
Requires (Dev)
- doctrine/coding-standard: ^10.0
- phpunit/phpunit: ^9.5
- psalm/plugin-phpunit: ^0.17.0
- roave/infection-static-analysis-plugin: ^1.23
- vimeo/psalm: ^4.27
This package is auto-updated.
Last update: 2024-09-07 18:36:24 UTC
README
这是一个简单的 PHP 实现 xissy/lexorank
LexoRank 是 Atlassian JIRA 引入的一种排名系统。
背景
如何在数据库中最好地表示一个有序列表?基于愚蠢的顺序号排名系统,重新排序列表中的一行可能需要更新列表中的所有行的事务,这是 O(n)。
- https://stackoverflow.com/questions/9536262/best-representation-of-an-ordered-list-in-a-database/49956113
- https://softwareengineering.stackexchange.com/questions/195308/storing-a-re-orderable-list-in-a-database
LexoRank 将其变为 O(1)。你所要做的就是更新重新排序行的顺序字段。