Giter VIP home page Giter VIP logo

networkproperties's Introduction

Network Properties in Spark GraphFrames

Implementation of various network properties using pySpark and GraphFrames. The various output Graphs are present in the Graphs folder and the various csv output files are present in the CSV folder. The stanford_graphs folder contains the various input graphs.

Run the following commands on any new terminal before running any code:

  • export SPARK_HOME=/usr/local/spark-1.6.2-bin-hadoop2.6
  • export PYSPARK_PYTHON=/usr/bin/python2
  • export PYSPARK_DRIVER_PYTHON=/usr/bin/python2

Degree:

The degree disstribution is the measure of the frequency of nodes that have a certain degree. The various graphs have been plotted using matplotlib.

Run the file using:

  • $SPARK_HOME/bin/pyspark --packages graphframes:graphframes:0.1.0-spark1.6 degree.py ./stanford_graphs/amazon.graph.large large OR
  • $SPARK_HOME/bin/pyspark --packages graphframes:graphframes:0.1.0-spark1.6 degree.py ./stanford_graphs/amazon.graph.small

Centrality

Centrality is a is a way to determine nodes that are important based on the structure of the graph. Here we have used Closeness Centrality which is a measure of the distance of a node to all other nodes. The output of the file is in centrality.csv

Run the file using:

  • $SPARK_HOME/bin/pyspark --packages graphframes:graphframes:0.1.0-spark1.6 centrality.py

Articulation

Articulation points are vertices in the graph that when removed, create more components than there were originally.

Run the file using:

  • $SPARK_HOME/bin/pyspark --packages graphframes:graphframes:0.1.0-spark1.6 articulation.py 9_11_edgelist.txt

networkproperties's People

Contributors

raveenaaa avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.