Closed
Conversation
超级节点的边数。与原来的ShortestPathAPI 相比添加了int 参数,这个参数限定了定点的最大边数量,避免了查询的时候经过超级节点。
超级节点的边数。与原来的ShortestPathAPI 相比添加了int 参数,这个参数限定了定点的最大边数量,避免了查询的时候经过超级节点。
|
|
zhoney
requested changes
Mar 21, 2019
|
|
||
| @Path("graphs/{graph}/traversers/shortestpath") | ||
| @Singleton | ||
| public class ShortestPathAPINew extends API { |
Contributor
There was a problem hiding this comment.
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) { |
Contributor
There was a problem hiding this comment.
'v.path()' returns node list traversed from source to current 'v'.
Should limit one node's edges number to avoid super node.
zhoney
requested changes
Mar 21, 2019
| @@ -0,0 +1,81 @@ | |||
| /* | |||
Contributor
|
@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. |
Contributor
|
Close since #433 is merged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
在最短路径中添加了超级节点,提升查询效率,参见https://github.com/hugegraph/hugegraph/issues/391。 与原来的ShortestPathAPI 相比添加了int 参数,这个参数限定了定点的最大边数量,避免了查询的时候经过超级节点。
ps:英语太差,就使用中文了(0.0)