networkit: an interactive tool suite for high-performance network

16
– NetworKit: An Interactive Tool Suite for High-Performance Network Analysis 1 A NetworKit Tutorial www.kit.edu KIT – University of the State of Baden-Wuerttemberg and National Laboratory of the Helmholtz Association I NSTITUTE OF T HEORETICAL I NFORMATICS · P ARALLEL COMPUTING GROUP

Upload: lamngoc

Post on 14-Feb-2017

227 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: NetworKit: An Interactive Tool Suite for High-Performance Network

– NetworKit: An Interactive Tool Suite for High-Performance Network Analysis 1

A NetworKit Tutorial

www.kit.eduKIT – University of the State of Baden-Wuerttemberg andNational Laboratory of the Helmholtz Association

INSTITUTE OF THEORETICAL INFORMATICS · PARALLEL COMPUTING GROUP

Page 2: NetworKit: An Interactive Tool Suite for High-Performance Network

– NetworKit: An Interactive Tool Suite for High-Performance Network Analysis 2

Introduction | Complex Networks

Non-trivial topological features that do not occur in simple networks(meshes, simple random graphs), but often occur in reality

Small diameterStrongly varying degree distributionLarge number of triangles...

Page 3: NetworKit: An Interactive Tool Suite for High-Performance Network

– NetworKit: An Interactive Tool Suite for High-Performance Network Analysis 3

Introduction | Network Science

Often

exploratory in nature

requires data preprocessing toextract graph

creates large data sets easily

requires domain-specific post-processing for interpretation

”Statistics of relational data”

image: sayasaya2011.wordpress.com/

→ Fast interactive toolkit required!

Page 4: NetworKit: An Interactive Tool Suite for High-Performance Network

– NetworKit: An Interactive Tool Suite for High-Performance Network Analysis 4

Introduction | Toolkit Design Goals

Performance

Implementation with efficiency and parallelism in mind

Interface

Exploratory workflows→ freely combinable functions and interactive interface

Integration

Seamless integration with Python ecosystemfor scientific computing and data analysis

Target Platforms

Shared-memory parallel computers

Multicore PCs, workstations, compute servers . . .

Page 5: NetworKit: An Interactive Tool Suite for High-Performance Network

– NetworKit: An Interactive Tool Suite for High-Performance Network Analysis 5

Introduction | NetworKit: Architecture

Page 6: NetworKit: An Interactive Tool Suite for High-Performance Network

– NetworKit: An Interactive Tool Suite for High-Performance Network Analysis 6

Introduction | NetworKit: Overview

Languages: C++, Python

Parallelism: Shared memory (OpenMP)

License: MIT

First release: 1.0 (March 2013)

Web: https://networkit.iti.kit.edu

Page 7: NetworKit: An Interactive Tool Suite for High-Performance Network

– NetworKit: An Interactive Tool Suite for High-Performance Network Analysis 7

Introduction | NetworKit: Graph Data Structure

graph implementation

graph API

image: algs4.cs.princeton.edu

Page 8: NetworKit: An Interactive Tool Suite for High-Performance Network

– NetworKit: An Interactive Tool Suite for High-Performance Network Analysis 8

NetworKit for theProgramming Projects

Page 9: NetworKit: An Interactive Tool Suite for High-Performance Network

– NetworKit: An Interactive Tool Suite for High-Performance Network Analysis 9

Download Mercurial (https://www.mercurial-scm.org)

Create an account on https://algohub.iti.kit.edu/

Send an e-mail to [email protected]

specifying your username and group number

Groups:

1. Graph Clustering, Tobias Lorenz and Johannes Ernst2. Partitioning, Michael Schrempp and Katharina Flugel3. TSP, Henning Dieterichs and Michael Wiegner4. Mapping, Holger Klein and Jasmin Hoffmann5. Framework, Tabu search, Sarah Dold and Sidney Bender

Page 10: NetworKit: An Interactive Tool Suite for High-Performance Network

– NetworKit: An Interactive Tool Suite for High-Performance Network Analysis 10

Clone the NetworKit fork corresponding to your group, e.g.hg clone https://[email protected]/parco/

NetworKit/NetworKit-AMfsO-Group1

Remember to work on the Dev branch!

hg up Dev

Before starting:

Read some code to get used to the code style and try to adoptit whenever possibleRead the DevGuide on the website:https://networkit.iti.kit.edu/api/DevGuide.html

Page 11: NetworKit: An Interactive Tool Suite for High-Performance Network

– NetworKit: An Interactive Tool Suite for High-Performance Network Analysis 11

Installing NetworKit

Page 12: NetworKit: An Interactive Tool Suite for High-Performance Network

– NetworKit: An Interactive Tool Suite for High-Performance Network Analysis 12

Building the C++ Core

Requirements:

modern C++ compiler, e.g.: g++ (≥ 4.8) or clang++ (≥ 3.7)SConsGoogle Test

https://networkit.iti.kit.edu/get_started.html#

building-only-the-c-core

Building executable for unit tests:

Copy build.conf.example to build.conf and edit your envi-ronment settingsscons --optimize=Dbg --target=Tests

Running unit tests

./NetworKit-Tests-Dbg --gtest filter=*Closeness*

Page 13: NetworKit: An Interactive Tool Suite for High-Performance Network

– NetworKit: An Interactive Tool Suite for High-Performance Network Analysis 13

Developing new classes

C++ classes:

networkit/cpp/ + subdirectories (corresponding to mod-ules on the python level)GTest: networkit/cpp/ + subdir + test

Always test your classes!

Exposing to Python: networkit/ NetworKit.pyx

https://networkit.iti.kit.edu/api/DevGuide.html#

exposing-c-code-to-python

Add your class to *.py file in the networkit folder

Always refer to the DevGuide on the website!!

Page 14: NetworKit: An Interactive Tool Suite for High-Performance Network

– NetworKit: An Interactive Tool Suite for High-Performance Network Analysis 14

Using NetworKit with IPython

Installation:

pip3 install -e ./

If you don’t have ipython and jupyter yet...

pip3 install ipython

pip3 install jupyter

Open jupyter notebook

Page 15: NetworKit: An Interactive Tool Suite for High-Performance Network

– NetworKit: An Interactive Tool Suite for High-Performance Network Analysis 15

Exercise

Page 16: NetworKit: An Interactive Tool Suite for High-Performance Network

– NetworKit: An Interactive Tool Suite for High-Performance Network Analysis 16

Read the file input/wiki-Vote.txt (format =EdgeListTabZero)

Compute:

1. Number of nodes and edges2. Number of connected components and size of the largest

connected component3. Node with maximum degree