-
Notifications
You must be signed in to change notification settings - Fork 41
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
Conversation
better add more test case (multi increase graph)
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
...ain/java/com/baidu/hugegraph/computer/algorithm/community/cc/ClusteringCoefficientValue.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
@Override | ||
public com.baidu.hugegraph.structure.graph.Vertex constructHugeVertex( |
There was a problem hiding this comment.
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
...ain/java/com/baidu/hugegraph/computer/algorithm/community/cc/ClusteringCoefficientValue.java
Outdated
Show resolved
Hide resolved
...ain/java/com/baidu/hugegraph/computer/algorithm/community/cc/ClusteringCoefficientValue.java
Outdated
Show resolved
Hide resolved
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 |
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 |
I'll address it soon |
some improve code could do it later (this PR only focus the CI pass) then we could start rename package & adopt the dependencies soon |
...src/main/java/com/baidu/hugegraph/computer/algorithm/community/cc/ClusteringCoefficient.java
Outdated
Show resolved
Hide resolved
...src/main/java/com/baidu/hugegraph/computer/algorithm/community/cc/ClusteringCoefficient.java
Outdated
Show resolved
Hide resolved
...src/main/java/com/baidu/hugegraph/computer/algorithm/community/cc/ClusteringCoefficient.java
Outdated
Show resolved
Hide resolved
return hugeVertex; | ||
} | ||
|
||
/* TODO: enhance it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused code?
There was a problem hiding this comment.
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)
...ain/java/com/baidu/hugegraph/computer/algorithm/community/cc/ClusteringCoefficientValue.java
Show resolved
Hide resolved
...ain/java/com/baidu/hugegraph/computer/algorithm/community/cc/ClusteringCoefficientValue.java
Outdated
Show resolved
Hide resolved
...ain/java/com/baidu/hugegraph/computer/algorithm/community/cc/ClusteringCoefficientValue.java
Outdated
Show resolved
Hide resolved
merge it after #194 |
...in/java/com/baidu/hugegraph/computer/algorithm/community/cc/ClusteringCoefficientOutput.java
Outdated
Show resolved
Hide resolved
@@ -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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep floating point type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
Codecov Report
@@ 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
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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