# mijuhan/Graph-Analytics----Triangle-Counting forked from vertica/Graph-Analytics----Triangle-Counting

Use Big data tools such as Vertica, Hadoop and PIG to count triangles in a graph. Experimentally compare their performance.
Switch branches/tags
Nothing to show
This branch is even with vertica:master.
Latest commit 59aa09e Nov 3, 2011
 Failed to load latest commit information. input Sep 16, 2011 scripts Sep 16, 2011 src/com/vertica/mr/graphs Sep 16, 2011 third-party Sep 16, 2011 README Sep 16, 2011 build.xml Nov 3, 2011

```This is a benchmark on an important graph analytics use case --
triangle counting. Read this blog post first (TBD) for the background
description.

We have provided the solutions in Hadoop, PIG and Vertica. You will be
able to test the Hadoop and PIG solutions on the data sets that we
provide. When the Vertica Community Edition is released, you will be
able to test the Vertica solution as well.

********************************************************************************
** CONTENTS
********************************************************************************
This file.

build.xml
makefile for ant.

input/few-edges.txt
Sample graph file, contains 36 reciprocal edges and six triangles. This is
an example of the input format required by the following three solutions.
Edges must be {source:long, dest:long} pairs and each edge must have a
reciprocal edges (that is, there must exist a {dest, source}). The input
format is:
<long> <whitespace> <long> <newline>
<repeat>

scripts/triangle_counter.sql
Vertica script to create an edges table, load data (from 'input/few-edges.txt'
by default) and execute a query that computes the number of triangles in
the corresponding graph.

scripts/triangle_counter.pig
PIG script that computes the number of triangles in a graph. The input is an
edges file (described above) and the output is the number of triangles.

src/com/vertica/mr/graphs/TriangleCounter.java
MapReduce code that runs in Hadoop and counts the number of triangles in
a graph. The input is an edges file (described above) and the output is the
number of triangles.

third-party/pig/pig-0.8.1.tar.gz
PIG libraries included for convenience.

********************************************************************************
** REQUIREMENTS
********************************************************************************

* Java 6. Please make sure it is in your path and JAVA_HOME is set correctly.

* Ant 1.6.5 or higher.

********************************************************************************
** EXAMPLES
********************************************************************************
Here are the basics. See the build.xml for other targets and full details.

The following command, when executed from the base directory, runs the hadoop
solution (in standalone mode) on the input/few-edges.txt file and outputs the
result to the ant output, as well as a directory named "result".

\$ ant triangle-counter-standalone

PIG:

The following command, when executed from the base directory, runs the PIG
solution (in local mode) on the input/few-edges.txt file and outputs the result
to the ant output.

\$ ant pig-triangle-counter-local

********************************************************************************
** PERFORMANCE TESTING
********************************************************************************
Our performance study is based on an input data set of 1.3GB in