the java universal network/graph ... -...

37
http://jung.sourceforge.net The Java Universal Network/Graph Framework (JUNG): A Brief Tour Joshua OMadadhain (UCI) Danyel Fisher (MSR), Tom Nelson (RABA Technologies) Scott White (UCI), Yan-Biao Boey (UCI)

Upload: vuongtuyen

Post on 29-Aug-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

The Java Universal Network/Graph Framework (JUNG):A Brief Tour

Joshua O’Madadhain (UCI)

Danyel Fisher (MSR), Tom Nelson (RABA Technologies)Scott White (UCI), Yan-Biao Boey (UCI)

Page 2: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

What’s it for?

phenomenae pertaining to relationships/links collaborations, citations/hyperlinks, email,

biological systems, friendships, telecom networks, ecological and biological systems, Markov processes, Bayes nets...

SUNBELT 2000 270 People & Structural Holes Database to UCINET to Pajek to MAGE

Page 3: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Programmatic Solution

ProgrammableMake it easy to do the same thing again

ExtensibleIf you need a new routine, you can put it in yourself

LibraryCan be used in a server, a client, or as part of a

larger application Open Source

Take it apart and put it together some other wayFree!

Page 4: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

What is JUNG?

Framework for the modeling, analysis, and visualization of graphs in Java

supports most types of graphs/networks separate, flexible visualization framework rich attribute structure (metadata) network event handling predicates (subsets, constraints, filtering, ...) extensive (and growing!) library of algorithms

Page 5: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Dependencies

Java (1.4.2+) Commons-Collections API (3.1)

http://jakarta.apache.org/commons/collections/Predicate, set operations, wrappers, data types (BidiMap)

CERN Colt API (1.2.0)http://dsd.lbl.gov/~hoschek/colt/matrix operations, statistics

Xerces (2.6.2)http://xml.apache.org/xerces2-j/index.htmlXML parsing

Page 6: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Overview

Creating a graph Annotating with data Filters Graph drawing Algorithms Demo

Page 7: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Creating a graph

Load from a file - Pajek - GraphML (XML)

Build from scratch- Create vertices individually- Specify edges

Generate from an algorithm/model- Small-world graphs- Power-law graphs

Page 8: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Graph Types

AbstractArchetypeGraph

AbstractSparseGraph

ArchetypeGraph

GraphHypergraph

SparseGraph

DirectedSparseGraphUndirectedSparseGraph

UndirectedGraph DirectedGraph

HypergraphBPG

KPartiteGraph

KPartiteSparseGraph

abstract class

interface

instantiable class

KEY

A B

B implements A

A B

B extends A

Page 9: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Vertex Types

ArchetypeVertex

Hypervertex VertexAbstractHyperUnitBPG

AbstractSparseVertexHypervertexBPG

SimpleSparseVertex(mixed)

SimpleDirectedSparseVertex(directed)

SimpleUndirectedSparseVertex(undirected)

SparseVertex(mixed, parallel)

DirectedSparseVertex(directed, parallel)

UndirectedSparseVertex(undirected, parallel)

LeanSparseVertex(mixed, parallel)

abstract class

interface

instantiable class

KEY

A B

B implements A

A B

B extends A

Page 10: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Edge Types

ArchetypeEdge

EdgeHyperedge

DirectedEdge UndirectedEdge

AbstractHyperUnitBPG

AbstractSparseEdge

DirectedSparseEdge UndirectedSparseEdge

HyperedgeBPG

abstract class

interface

instantiable class

KEY

A B

B implements A

A B

B extends A

Page 11: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Creating a Graph

Graph g = new DirectedSparseGraph();Vertex v1 = new SparseVertex();Vertex v2 = new SparseVertex();g.addVertex( v1 );g.addVertex( v2 );Edge e = new Edge( v1, v2 );g.addEdge( e );

Page 12: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Adding user-defined data key-value pairs associated with

graphs, edges, vertices easy to write algorithms that operate on

relational data

String name = vertex.getUserDatum(NAME);edge.setUserDatum(DATE, new Date());

Page 13: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Copying and Equality

copies of vertices and edges are “equal to” the originals – equals(), hashCode()

– subgraphs– allows experimentation with mutations to

graph, without affecting original

v2 = v1.getEqualVertex(g2)

Page 14: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Predicates

logical expressions, e.g.v.degree() > 4e instanceof DirectedEdge

can be used to define subsets and constraints – k-partite graphs– multigraphs, simple graphs, trees, mixed-

mode graphs, hypergraphs, ...

Page 15: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Using graph filters

Extract subgraphs of vertices and edges– All edges with user-data “weight” > 0.2– All nodes whose “location” is “California”– All nodes within distance 3.5 of v

Chain filters together Automate complex graph

transformations

Page 16: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Visualizing graphs Basic layout algorithms:

– Fruchterman-Rheingold– Kamada-Kawaii– Eades– Self-Organizing Maps

Plug and play architecture- Drop in your favorite renderer, layout

Provided rendering engine is Swing-based - (but layouts are generic)

Page 17: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Simple Graph Display

to display an existing graph:l = new FRLayout(g);r = new PluggableRenderer();vv = new VisualizationViewer(l,r);jpanel.add(vv);

now, start customizing...

Page 18: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

PluggableRenderer

Page 19: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Customizing

Layout algorithms specify vertex positionsadvancePositions()

Renderers draw vertices and edges.paintEdge( g, Edge, x1, y1, x2, y2 )paintVertex( g, Vertex, x, y )

Page 20: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Algorithms

clustering k-neighborhood

connected components

k-means clustering

connectivity

maximum flow

network distances

structural equivalence

centrality/importancebetweenness,markov,PageRank, hubs-and-authorities,voltage,...

Page 21: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

bold text

show undirected edge arrows

show edge weights

edge weight highlighting

vertex degree ratio stretch

vertex voltage size

vertex degree shapes

show vertex ranks (voltages)

vertex selection stroke highlighting

vertex seed coloring

ranking

Page 22: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

M Pazzani

M Fernandez O Mangasarian

M Hearst

M Jordan

C Lai

T Richardson

C Meek

C Glymour

P Sabes

J FrankP Cheeseman

J Stutz

M Wellman

D Cohn

A Smith

B Draper

J Erickson

C Brodley

P Smyth

J Weber

J Malik

D Heckerman

A Jones

E Knill

B Bollobas

G Das

D Gunopulos

H Mannila

S Teng

D Mitchell

R Khardon

D Roth

A Raftery

D Madigan

J Hoeting M Kersten

O Miglino

K Nafasi

C Taylor

D Wolpert

W Macready

A Hill

T Cootes

Z Ghahramani

S Dumais

P Chan

S Soatto

P Perona

R FrezzaG Picci

M Mitchell

T Jaakkola

D Haussler

P Orponen

K Murphy

H GreenspanS Belongie

R Goodman

M Holsheimer

J Matousek

L Xu

M Paterson

M KlemettinenH Toivonen

A Weigend

S Jung

J Boulicaut

S CasadeiS Mitter

J Adams

J Kosecka

R Paul

A Farquhar

R Kohavi

M Jaeger

J Ostrowski

K Bennett

A Ng

P Ronkainen

L Guibas

B Dom

M Sahami

J Bouguet

J Rice

D Dobkin

D Eppstein

T Hastie

P Agarwal

E Ukkonen

G OvertonJ Aaronson

J Haas

Z Wang

D Hart

G Gottlob

P Stolorz F Yao

A Robertson

E Horvitz

S Singh

B Fischer

T Leung

H AhonenO Heinonen

P Kilpelainen

M Atkinson

D Peel

G Miller

S Russell

W Buntine

J Fortes

L Saul

M Dillencourt

Y Weiss

C Volinsky

R Kronmal

A Gray

S Hanks

V Tsaoussidis

H Badr

D Kriegman

T Lane

J Gilbert

P Debevec

J Kivinen

J Crowcroft

R Beigel

A Mayer

B MacLennan

G Edwards

C Matheus

G Piatetsky-Shapiro

D McNeill

P Utgoff

R Fikes

R Jacobs

M Weber

J Gavrin

K Chang

D Hirschberg

E Hunt

S MacDonell

Z Galil

E Weydert

D Thomas

M Henzinger

M Burl

M Bern

P Sozou

J Graham

E DemaineM Demaine

S Spence

D Geiger

M Friedl

T Eiter

E Alpaydin

S Solloway

C Hutchinson

J WatertonD Cooper

A Barto

E Nikunen

E Dimauro

G LindenA Verkamo

I Verkamo

L Goncalves

G Cooper

A Newton

R Kraft

J Breese

N Amenta

I Cadez

C McLaren

G McLachlan

G Barequet

M Meila

Q Morris

Y Song

S Andersson

M Perlman

P Bradley

U Fayyad

D WolfG Italiano

K Tumer

E Keogh

E BernardoE Ursella

C Triggs

D Sornette

E Friedman

L DaynesT Printezis

T Pressburger

B Tuttle

J Haslam

G PageC Jackson

C Bishop

D Pavlov

M Dickerson

N de Freitas

C Stauss

R Kilgour

R Manduchi

G Graefe

R Shachter

K MosurskiR Almond

D Young

A Lapedes

R Blasi

D ChickeringR Giancarlo

K Wheeler

A Lanitis

P Prado

X Ge

S Payandeh

M Ghil

K Ide

H King

I Dryden

B Thiesson

D Pregibon

A KorholaH Olander

W Pratt

R Engelmore

A Brett

C Sayers

J Mao

M Salmenkivi

A Mamdani

J Iv

M Welling

B Kanefsky

W Taylor

C Strauss

K Walker

M Faghihi

E Di Bernardo

P Kube

K Rommelse

D Rumelhart

S GaffneyC ReinaS ChaudhuiriP Sallis

K LaaksoB Levidow

D Donnell

M Tartagni

M Vanter

N Lawrence

C FowlkesJ Roden

G Ridgeway

E Kuo

L Su

M Munich

D GolinelliG Consonni

D Cunliffe

D PsaltisG Steckman

P Courtier

M Latif

I Sim

L Cordero

L Ugarte

K Pentikousis

N Kapadia

J seck

F Lott

D Chudova

P Yiou

W Einhauser

P VetterS Goodbody

M Kawato

P Hrensen

M Levitz

clustering

Page 23: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Event Handling

addition/removal of vertices/edges– graphs generate events

modification of user data repository– (JUNG) objects generate events

mouse events– can be parsed as selection, panning, zooming,

pop-ups, property changes, functions, ...

objects can register as listeners

Page 24: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Statistical Analysis

Graph measures:– Degree distributions– Average shortest path length, diameter– Clustering coefficients

can use existing Java statistical packages CERN Colt Scientific Library Visual Numeric’s JMSL for Java

Page 25: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Conclusion

Provides a common language for graphs Complements rather than replaces other

graph packages/network tools A powerful framework for working with

graphs with rich attribute structure Ideally suited for building tools/

applications related to network exploration and data mining

Page 26: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Adoption

Users are writing social network analyses, games, animated

graph views, transportation network algorithms, Google Cartography, ...

Page 27: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

Email visualization

Page 28: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

Newsgroup Networks

Page 29: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

Temporal Egocentric Communication Networks

Page 30: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

Open-SourceCollaboration

Page 31: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

LiveJournal networks

Page 32: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Integrated into an application

Page 33: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Freeman’s Southern Women

Page 34: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

Shortest Path

Page 35: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Demo

Betweenness Centrality

Page 36: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Small Multiples[Sun, E1]

Page 37: The Java Universal Network/Graph ... - jung.sourceforge…jung.sourceforge.net/presentations/JUNG_M2K.pdf · ... D Hart G Gottlob P Stolorz F Yao A Robertson E Horvitz S Singh

http://jung.sourceforge.net

Thanks

http://jung.sourceforge.net

Feel free to just play with it…Or join us! Active collaboration is

welcome.

Supported in part by NSF.