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

Implement degree assortativity coefficient app #492

Merged
merged 34 commits into from
Aug 17, 2021
Merged

Conversation

Ningsir
Copy link
Contributor

@Ningsir Ningsir commented Jul 7, 2021

What do these changes do?

Implement degree assortativity coefficient app with cpp.

  • implement C++ PIE app with analytical engineAPI;
  • check the correctness with NetworkX
  • check the scalability and performance in large graph, like com-friendster dataset
  • add to python built-in algorithms and add related test case

Related issue number

#453

Experiment

Experiment setting:

  • Ubuntu20.04;
  • 32G memory;
  • workers_num = 4;
  • NetworkX version: 2.6.2;
  • dataset: Twitter, datagen-7_5-fb, datagen-7_7-zf, datagen-8_0-fb.
Time GraphScope NetworkX GraphScope(weight=1) NetworkX(weight=1)
Twitter 1.37 S 3.2 S 26.71 S 90.25 S
datagen-7_5-fb 26.72 S 136.07 S 162.67 S 4018.23 S
datagen-7_7-zf 22.27 S 169.96 S 35.86 S 623.15 S
datagen-8_0-fb 58.20 S 844.42 S 543.95 S OOM
Memory Usage
Twitter 0.96 G 0.578 G 1.38 G 1.31 G
datagen-7_5-fb 8 G 13.28 G 9.6 G 16.42 G
datagen-7_7-zf 23.04 G 25.92 G 24.32 G 26.24 G
datagen-8_0-fb 25.6 G 30.78 G 29.44 G OOM

@CLAassistant
Copy link

CLAassistant commented Jul 7, 2021

CLA assistant check
All committers have signed the CLA.

@acezen acezen changed the title add degree assortativity in cpp [WIP] Add degree assortativity in cpp Jul 8, 2021
Copy link
Collaborator

@acezen acezen left a comment

Choose a reason for hiding this comment

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

nice start.

@Ningsir Ningsir marked this pull request as draft July 8, 2021 13:10
@acezen
Copy link
Collaborator

acezen commented Jul 9, 2021

hi, @Ningsir, please assign the cla agreement and pass the ci, especially the code format check.

@Ningsir Ningsir marked this pull request as ready for review July 9, 2021 07:09
@yecol yecol marked this pull request as draft July 15, 2021 07:22
using oid_t = typename fragment_t::oid_t;
using edata_t = typename fragment_t::edata_t;

typedef double degree_t;
Copy link
Collaborator

@acezen acezen Aug 2, 2021

Choose a reason for hiding this comment

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

using degree_t = double;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

void PEval(const fragment_t& frag, context_t& ctx,
message_manager_t& messages) {
ctx.merge_stage = false;
// vid
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove unnecessary comments

ctx.merge_stage = false;
// vid
auto inner_vertices = frag.InnerVertices();
// v of type: Vertex
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

#define ANALYTICAL_ENGINE_APPS_ASSORTATIVITY_UTILS_H_

namespace gs {
enum class DegreeType { IN, OUT, INANDOUT };
Copy link
Collaborator

Choose a reason for hiding this comment

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

just put enum to context.h, no need to add a new file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

DegreeType and some codes about matrix computation can be reused in numeric assortativity app. I will rafactor and put these codes in utils.h

@Ningsir Ningsir changed the title [WIP] Add degree assortativity in cpp [WIP] Implement degree assortativity coefficient app Aug 9, 2021
}

template <typename T>
degree_t ComputeWeightedDegree(T adjList) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

add some comment about the function. If the function is simple, we should use inline

Copy link
Collaborator

@acezen acezen left a comment

Choose a reason for hiding this comment

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

hi, I add some reviews on the latest pr.
Can you add a test case with p2p-31? like

def test_katz_centrality(self):
ans = dict(nx.builtin.katz_centrality(self.p2p, weight="default").values)
self.assert_result_almost_equal(ans, self.p2p_kz_ans)

@acezen acezen changed the title [WIP] Implement degree assortativity coefficient app Implement degree assortativity coefficient app Aug 17, 2021
Copy link
Collaborator

@acezen acezen left a comment

Choose a reason for hiding this comment

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

Good job! Thanks for the contribution.

@acezen acezen merged commit e092774 into alibaba:main Aug 17, 2021
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.

3 participants