Skip to content

commit 添加了最短路径的超级节点#397

Closed
platypus0127 wants to merge 6 commits intoapache:masterfrom
platypus0127:master
Closed

commit 添加了最短路径的超级节点#397
platypus0127 wants to merge 6 commits intoapache:masterfrom
platypus0127:master

Conversation

@platypus0127
Copy link
Copy Markdown

@platypus0127 platypus0127 commented Mar 19, 2019

在最短路径中添加了超级节点,提升查询效率,参见https://github.com/hugegraph/hugegraph/issues/391。 与原来的ShortestPathAPI 相比添加了int 参数,这个参数限定了定点的最大边数量,避免了查询的时候经过超级节点。

ps:英语太差,就使用中文了(0.0)

超级节点的边数。与原来的ShortestPathAPI 相比添加了int 参数,这个参数限定了定点的最大边数量,避免了查询的时候经过超级节点。
超级节点的边数。与原来的ShortestPathAPI 相比添加了int 参数,这个参数限定了定点的最大边数量,避免了查询的时候经过超级节点。
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.


@Path("graphs/{graph}/traversers/shortestpath")
@Singleton
public class ShortestPathAPINew extends API {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modify ShortestPathAPI and ShortestPathTraverser directly to enhance original function.

// Traversal vertices of previous level
for (Node v : this.sources.values()) {
//TODO 判断是否为超级节点,如当前节点边的数量大于1000,就不经过滤当前点
if(v.path().size()< max_edges) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'v.path()' returns node list traversed from source to current 'v'.
Should limit one node's edges number to avoid super node.

@@ -0,0 +1,81 @@
/*
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign CLA.

@zhoney
Copy link
Copy Markdown
Contributor

zhoney commented Apr 3, 2019

@platypus0127 As you don't go a step further in a long time, I will implement it in #433 . Also, I will set you as coauthor. Thanks again for your commit.

@javeme
Copy link
Copy Markdown
Contributor

javeme commented Apr 8, 2019

Close since #433 is merged

@javeme javeme closed this Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants