User 112 | 3/24/2015, 4:10:01 PM

Hello.
I try implement algoritm with attacks on hubs(vertex with high degree). Attach: attack.cpp.txt
I created equivalent algorithm using igraph python package. Attach: attack*python.txt
I compare result both algorithm using test graph. Attach: test*graph.txt in tsv format.
My Graphlab's algoritm resulted sometimes equal igraph's, but sometimes not. Attach: result_compare.txt
When i set ncpus = 1 they always equal.

I'm sorry for big size of source files. But I will be glad any hints about what wrong.

User 1190 | 3/24/2015, 5:23:47 PM

Is the algorithm deterministic under async parallel execution? If not sure, you can try using synchronous engine which might give you more stable answers.

User 112 | 3/24/2015, 5:50:33 PM

Algorithm not deterministic under both engine: synchronous and asynchronous I tried with --engine=synchronous , but it is still not deterministic

User 112 | 4/6/2015, 5:33:03 PM

Finally, i resolved this issue: if we have several hubs(vertices with higher degree) with equal degree, igraph chose one with small id between them, but my algorithm choose one random. Hubs with equal degree but different betweenness centrality have different impact to gian cluster in graph. Like in image - removing vertex 6 give more destruction. <img src="http://cdn.vanillaforums.com/graphlab.vanillaforums.com/editor/5g/7h6gruyokhjt.jpg" alt="" />

I have another question, what is the fastest way to find N hubs in graph using GraphLab API? I need sort vertices by degree and get N vertex with higher degree from them

Currently i'am using
1. hub*counter hub*stat = graph.map*reduce*vertices<hub*counter>(hub*data, alive*vertex*set);
2. get N vertices from hub_stat.

hub*counter hub*data(const graph*type::vertex*type& vertex) {
return hub_counter( vertex.id(), vertex.data().degree);
}

struct hub*counter {
std::map<u*int64*t, std::set<u*int64*t> > hub*with_degree;

explicit hub*counter(u*int64*t id, u*int64*t degree) {
hub*with_degree[degree].insert(id);
}

hub*counter& operator+=(const hub*counter& other) {
for(std::map<u*int64*t, std::set<u*int64*t> >::const*iterator iter = other.hub*with*degree.begin();
iter != other.hub*with*degree.end(); iter++) {
for(std::set<u*int64*t>::const*iterator nested*iter = iter->second.begin();
nested*iter != iter->second.end(); nested*iter++) {
hub*with*degree[iter->first].insert(*nested*iter);
}
}
}

User 112 | 4/6/2015, 5:36:29 PM

attached hub_counter

User 1190 | 4/6/2015, 5:46:18 PM

What you proposed is a good way to find N hubs.

User 112 | 4/6/2015, 5:52:14 PM

Hello Jay Gu. Ok, thanks for reply.