Giter Club home page Giter Club logo

peaklib's Introduction

Peak Package

This package is the installable python package for peforming k-peak decomposition and plotting mountain plots. If using k-peak decomposition or the mountain-plot, please cite the following paper:

Priya Govindan, Chenghong Wang, Chumeng Xu, Hongyu Duan, Sucheta Soundarajan. The k-peak decomposition: Mapping the global structure of graphs. WWW 2017

Installation

Required packages:

Please make sure the above packages are installed and enabled properly before you install the peak package. Change your directory to the root folder of peak package, and use the following command to install the package:

python setup.py install

After installation you can check the functionality of peak package by running the sample code scripts. Sample script is located at folder sample_code/.

Usage

Sample usage: Import peak package to include all functionalities in peak package, import code as follow:

import peak.kpeak as kp

Graph Input:

  • Format: Undirected, unweighted graph in the form of a text file of comma separated edge-list. An example input file, ‘toygraph.txt’, is provided.
  • Reading the graph: The graph is to be read a Networkx graph. The file ‘sample_usage.py’ demonstrates how to read the input file and call the functions to compute k-peak decomposition and create mountain-plots.
  • Note that we assume that every node has at least one edge. Singletons are removed before k-peak decomposition is done. Singletons have core and peak number of 0.
  • Self-loops are ignored.

Interface Reference

  1. get_kpeak_decomposition : Given a graph, it computes the peak number of every node in the graph. Input is a a Networkx graph object. Output is a dictionary of core numbers and a dictionary of peak numbers. The keys in both dictionaries are node IDs and the values are the peak or core number.

  2. plot_mountains_given_mountainassignment : Given a graph, it creates the mountain-plot of the graph. Input is a a networkx graph object and a graph name in String. Output is a PDF file of the mountain-plot in the same directory as the code.

——————————————————

peaklib's People

Contributors

lovingmage avatar

Stargazers

 avatar  avatar

Watchers

 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.