Skip to content

Instantly share code, notes, and snippets.

@farkhor
farkhor / vertex_index_minimizer.cpp
Last active April 27, 2020 02:19
This program takes the input graph as an edge list, and outputs an equivalent graph in which index vertices are minimized. In other words, it converts input graph's vertex indices to non-negative numbers so that if there exists an index a>0, and 0<=b<a, there will exist index b in the list of edges as a source and/or destination vertex.
/*
* vertex_index_minimizer.cpp
*
* Created on: Sep 21, 2015
* Author: Farzad Khorasani
*/
#include <iostream>
#include <string>
#include <cstring>
@farkhor
farkhor / pr_input_provider.cpp
Last active October 8, 2015 01:21
This program transforms the structure of the input edge list to the form required for PageRank (PR) algorithm in vertex-centric frameworks. PR needs the number of neighbors of the destination vertex be provided in the input file as the third argument of every edge in the edge-list (after the source vertex index and destination vertex index).
/*
* pr_input_provider.cpp
*
* Created on: Aug 31, 2015
* Author: Farzad Khorasani
*/
#include <iostream>
#include <string>
#include <cstring>