Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support cluster coefficient algorithm #108

Merged
merged 20 commits into from
Nov 23, 2022
Merged

feat: support cluster coefficient algorithm #108

merged 20 commits into from
Nov 23, 2022

Conversation

imbajin
Copy link
Member

@imbajin imbajin commented Sep 28, 2021

better add more test case (multi increase graph) & refactor later, the doc for it will attach in wiki first

Not redy for review: wait test stable & refact it later

better add more test case (multi increase graph)
@codecov
Copy link

codecov bot commented Sep 28, 2021

Codecov Report

Merging #108 (eace58a) into master (b796128) will decrease coverage by 0.17%.
The diff coverage is 66.03%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #108      +/-   ##
============================================
- Coverage     87.94%   87.77%   -0.18%     
- Complexity     2827     2858      +31     
============================================
  Files           295      301       +6     
  Lines         10630    10749     +119     
  Branches        900      912      +12     
============================================
+ Hits           9349     9435      +86     
- Misses          854      881      +27     
- Partials        427      433       +6     
Impacted Files Coverage Δ
.../algorithm/centrality/degree/DegreeCentrality.java 70.96% <0.00%> (-0.91%) ⬇️
...rithm/community/cc/ClusteringCoefficientValue.java 0.00% <0.00%> (ø)
.../algorithm/community/cc/ClusteringCoefficient.java 89.79% <89.79%> (ø)
...ithm/community/cc/ClusteringCoefficientOutput.java 100.00% <100.00%> (ø)
...ithm/community/cc/ClusteringCoefficientParams.java 100.00% <100.00%> (ø)
...mputer/k8s/operator/common/AbstractController.java 84.34% <0.00%> (-0.51%) ⬇️
...egraph/computer/core/sort/sorting/SortManager.java 80.00% <0.00%> (ø)
...ph/computer/core/sort/sorting/RecvSortManager.java 100.00% <0.00%> (ø)
...ph/computer/core/sort/sorting/SendSortManager.java 100.00% <0.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b796128...eace58a. Read the comment docs.

}

@Override
public com.baidu.hugegraph.structure.graph.Vertex constructHugeVertex(
Copy link
Contributor

Choose a reason for hiding this comment

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

prefer to override value() method

@github-actions
Copy link

github-actions bot commented Dec 4, 2021

Due to the lack of activity, the current pr is marked as stale and will be closed after 180 days, any update will remove the stale label

@github-actions github-actions bot closed this Jun 3, 2022
@imbajin imbajin reopened this Jun 4, 2022
@imbajin imbajin added feature New feature and removed inactive labels Jun 4, 2022
@github-actions
Copy link

github-actions bot commented Jul 4, 2022

Due to the lack of activity, the current pr is marked as stale and will be closed after 180 days, any update will remove the stale label

@imbajin
Copy link
Member Author

imbajin commented Oct 21, 2022

I'll address it soon

@imbajin imbajin self-assigned this Oct 21, 2022
@imbajin imbajin marked this pull request as ready for review October 31, 2022 11:22
@imbajin imbajin requested a review from coderzc October 31, 2022 11:23
@imbajin
Copy link
Member Author

imbajin commented Oct 31, 2022

some improve code could do it later (this PR only focus the CI pass)

then we could start rename package & adopt the dependencies soon

@github-actions github-actions bot removed the inactive label Nov 1, 2022
return hugeVertex;
}

/* TODO: enhance it
Copy link
Contributor

Choose a reason for hiding this comment

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

unused code?

Copy link
Member Author

Choose a reason for hiding this comment

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

useful, maybe use it in next PR (but not this time)

javeme
javeme previously approved these changes Nov 3, 2022
@imbajin
Copy link
Member Author

imbajin commented Nov 7, 2022

merge it after #194

@imbajin imbajin requested a review from javeme November 22, 2022 13:53
coderzc
coderzc previously approved these changes Nov 22, 2022
@imbajin
Copy link
Member Author

imbajin commented Nov 22, 2022

image

@@ -48,7 +48,7 @@ protected org.apache.hugegraph.structure.graph.Vertex constructHugeVertex(Vertex
org.apache.hugegraph.structure.graph.Vertex hugeVertex =
new org.apache.hugegraph.structure.graph.Vertex(null);
hugeVertex.id(vertex.id().asObject());
float triangle = ((ClusteringCoefficientValue) vertex.value()).count();
long triangle = ((ClusteringCoefficientValue) vertex.value()).count();
int degree = ((ClusteringCoefficientValue) vertex.value()).idList().size();
hugeVertex.property(this.name(), 2 * triangle / degree / (degree - 1));
Copy link
Member

Choose a reason for hiding this comment

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

Keep floating point type?

Copy link
Member Author

Choose a reason for hiding this comment

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

yep

@codecov
Copy link

codecov bot commented Nov 22, 2022

Codecov Report

Merging #108 (fe68e84) into master (86e548c) will increase coverage by 0.01%.
The diff coverage is 89.42%.

@@             Coverage Diff              @@
##             master     #108      +/-   ##
============================================
+ Coverage     86.01%   86.03%   +0.01%     
- Complexity     3207     3237      +30     
============================================
  Files           341      345       +4     
  Lines         12197    12292      +95     
  Branches       1085     1097      +12     
============================================
+ Hits          10491    10575      +84     
- Misses         1183     1187       +4     
- Partials        523      530       +7     
Impacted Files Coverage Δ
...idu/hugegraph/computer/core/graph/value/Value.java 78.57% <ø> (ø)
...ugegraph/computer/core/config/ComputerOptions.java 100.00% <ø> (ø)
...puter/core/network/netty/AbstractNettyHandler.java 47.50% <ø> (ø)
...idu/hugegraph/computer/core/util/ShutdownHook.java 44.44% <ø> (ø)
.../algorithm/centrality/degree/DegreeCentrality.java 65.51% <33.33%> (-2.23%) ⬇️
...rithm/community/cc/ClusteringCoefficientValue.java 83.33% <83.33%> (ø)
.../algorithm/community/cc/ClusteringCoefficient.java 89.79% <89.79%> (ø)
...ithm/community/cc/ClusteringCoefficientOutput.java 100.00% <100.00%> (ø)
...ithm/community/cc/ClusteringCoefficientParams.java 100.00% <100.00%> (ø)
...hm/community/trianglecount/TriangleCountValue.java 100.00% <100.00%> (ø)
... and 2 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@imbajin imbajin merged commit 8b7dbd6 into master Nov 23, 2022
@imbajin imbajin deleted the cc-algo branch November 23, 2022 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants