TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Owing Graph Minimization

13 点作者 rgawdzik将近 10 年前

3 条评论

justinnhli将近 10 年前
I&#x27;m confused. The article seems to require that people pay whoever they owe, as opposed to whoever is owed money. It seems we can simply sort the people by the amount owed, then have the person at the top of that list pay the person at the bottom, and repeat until all debt is resolved. This is an nlog(n) algorithm (for the sorting), and creates at most n edges (since, for every transaction, someone either pays back everything they owe, or someone gets paid everything they are owed).<p>Is there something I&#x27;m missing?
评论 #9899345 未加载
sophacles将近 10 年前
The output list makes the tuples different than the input... there is no way that john suddenly owes beryl 25 for example.<p>I don&#x27;t see an explanation for this in the text - but a directed edge seems to switch from a semantic of &quot;owes&quot; to &quot;is owed&quot;.
chaoxu将近 10 年前
Another way to think of this problem is find a feasible flow in a complete graph that satisfy all vertex demands and using minimum number of edges.