MCPcopy Create free account
hub / github.com/Tencent/plato / unbiased_walk

Function unbiased_walk

example/node2vec_randomwalk.cc:275–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273}
274
275void unbiased_walk(void) {
276 //using walk_engine_spec_t = plato::walk_engine_t<false>;
277 using part_spec_t = plato::hash_by_source_t<>;
278 using walk_engine_spec_t = plato::walk_engine_t<plato::cbcsr_t<plato::empty_t, part_spec_t>, plato::empty_t>;
279
280 plato::stop_watch_t watch;
281 plato::graph_info_t graph_info(false);
282
283 watch.mark("t1");
284 auto cache = plato::load_edges_cache<plato::empty_t, plato::vid_t, plato::edge_cache_t>(&graph_info, FLAGS_input, plato::edge_format_t::CSV,
285 plato::dummy_decoder<plato::empty_t>);
286
287 auto& cluster_info = plato::cluster_info_t::get_instance();
288 if (0 == cluster_info.partition_id_) {
289 LOG(INFO) << "edges: " << graph_info.edges_;
290 LOG(INFO) << "vertices: " << graph_info.vertices_;
291 LOG(INFO) << "max_v_id: " << graph_info.max_v_i_;
292 LOG(INFO) << "is_directed_: " << graph_info.is_directed_;
293
294 LOG(INFO) << "load edges cache cost: " << watch.show("t1") / 1000.0 << "s";
295 }
296
297 std::shared_ptr<partition_t> partitioner(new partition_t());
298 walk_engine_spec_t engine(graph_info, *cache, partitioner);
299 cache.reset();
300 walk(engine);
301}
302
303int main(int argc, char** argv) {
304 init(argc, argv);

Callers 1

mainFunction · 0.70

Calls 4

markMethod · 0.80
showMethod · 0.80
walkFunction · 0.70
resetMethod · 0.45

Tested by

no test coverage detected