You are on page 1of 37

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) 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
! !

http://jung.sourceforge.net

Programmatic Solution
!

Programmable
Make it easy to do the same thing again

Extensible
If you need a new routine, you can put it in yourself

Library
Can 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 way Free!
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, exible visualization framework rich attribute structure (metadata) network event handling predicates (subsets, constraints, ltering, ...) extensive (and growing!) library of algorithms
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.html XML parsing http://jung.sourceforge.net

Overview
!

Creating a graph Annotating with data Filters Graph drawing Algorithms Demo

http://jung.sourceforge.net

Creating a graph
" Load from a le
- Pajek - GraphML (XML)

" Build from scratch


- Create vertices individually - Specify edges

" Generate from an algorithm/model


- Small-world graphs - Power-law graphs
http://jung.sourceforge.net

Graph Types
ArchetypeGraph

Hypergraph

AbstractArchetypeGraph

Graph

AbstractSparseGraph

HypergraphBPG UndirectedGraph DirectedGraph

SparseGraph KPartiteGraph

KEY interface abstract class instantiable class A B

B implements A A B

B extends A

UndirectedSparseGraph

DirectedSparseGraph

KPartiteSparseGraph

http://jung.sourceforge.net

Vertex Types
ArchetypeVertex

AbstractHyperUnitBPG

Hypervertex

Vertex

HypervertexBPG

AbstractSparseVertex

KEY interface abstract class instantiable class A B

LeanSparseVertex (mixed, parallel)

SimpleSparseVertex (mixed)

SimpleDirectedSparseVertex (directed)

SimpleUndirectedSparseVertex (undirected)

B implements A A B SparseVertex (mixed, parallel) DirectedSparseVertex (directed, parallel) UndirectedSparseVertex (undirected, parallel)

B extends A

http://jung.sourceforge.net

Edge Types
ArchetypeEdge

AbstractHyperUnitBPG

Hyperedge

Edge

HyperedgeBPG DirectedEdge KEY interface abstract class instantiable class A B

AbstractSparseEdge UndirectedEdge

B implements A A B DirectedSparseEdge UndirectedSparseEdge

B extends A

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 );

http://jung.sourceforge.net

Adding user-dened 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());

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)
http://jung.sourceforge.net

Predicates
!

logical expressions, e.g.


v.degree() > 4 e instanceof DirectedEdge

can be used to dene subsets and constraints


k-partite graphs multigraphs, simple graphs, trees, mixedmode graphs, hypergraphs, ...
http://jung.sourceforge.net

Using graph lters


!

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 lters together Automate complex graph transformations


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)
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...

http://jung.sourceforge.net

Pluggable Renderer

Customizing
Layout algorithms specify vertex positions advancePositions() Renderers draw vertices and edges.
paintEdge( g, Edge, x1, y1, x2, y2 ) paintVertex( g, Vertex, x, y )

http://jung.sourceforge.net

Algorithms
clustering
k-neighborhood connected components k-means clustering

centrality/importance
betweenness, markov, PageRank, hubs-and-authorities, voltage, ...

connectivity maximum flow network distances structural equivalence

http://jung.sourceforge.net

ranking

R Almond K Mosurski B Levidow E Hunt D Golinelli G Consonni D Donnell R Kronmal M Levitz A Raftery M Perlman J Gavrin C Volinsky J Hoeting S Hanks C Triggs S Andersson

T Richardson D Madigan D Sornette P Yiou M Latif A Robertson F Lott G Ridgeway T Hastie J Iv

K Laakso M Salmenkivi I Verkamo J Boulicaut A Verkamo M Holsheimer E Nikunen H Toivonen P Orponen M Kersten G Linden H Ahonen M Klemettinen P Kilpelainen O Heinonen M Jaeger H Olander A Korhola E Weydert G Gottlob T Eiter P Ronkainen D Roth H Mannila G Das R Khardon B Bollobas

E Ukkonen

M Friedl B Draper P Utgoff J Fortes N Kapadia T Lane

P Courtier C Lai K Chang M Ghil D Pregibon C Glymour J Kivinen

D Gunopulos

J Mao B Dom

C Brodley D McNeill C Matheus P Chan

K Ide P Prado D Peel

D Pavlov

D Dobkin D Chudova G McLachlan V Tsaoussidis G Piatetsky-Shapiro C Reina J Roden H Badr S Chaudhuiri MS Tartagni I Cadez Gaffney D Mitchell C Fowlkes K Pentikousis S Casadei S Mitter P Kube G Graefe P Bradley C McLaren L Cordero A Gray D Psaltis L Guibas D Hart X Ge J Bouguet R Manduchi G Steckman M Fernandez L Ugarte M Welling O Mangasarian W Einhauser M Munich J Matousek U Fayyad M Henzinger P Stolorz F Yao E Bernardo E Ursella J Erickson M Paterson PBurl Smyth M P Agarwal K Bennett L Goncalves E Friedman D Haussler C Meek D Eppstein Y Song E Demaine E Di Bernardo M Demaine N Amenta P Perona E Keogh E Kuo D Geiger J Rice M Bern G Barequet D Hirschberg W Pratt M Pazzani J Gilbert S Teng M Dickerson E Knill R Fikes A Farquhar M Dillencourt T Leung D Chickering H King G Picci R Beigel R Giancarlo R Frezza B Thiesson R Engelmore G Miller M Weber R Goodman G Cooper G Italiano P Cheeseman J Frank D Wolf I Sim Z Galil M Hearst C Strauss J Stutz S Goodbody S Belongie D Heckerman P Vetter H Greenspan D Wolpert B Kanefsky S Soatto M Sahami R Kohavi E Horvitz W Buntine R Kraft C Stauss K Wheeler W Taylor Z Wang S Payandeh K Tumer M Kawato A Smith S Dumais A Mayer W Macready J Crowcroft A Newton B MacLennan B Tuttle C Sayers J Adams R Shachter A Mamdani A Lapedes L Su K Rommelse J Haas R Paul J Breese A Weigend M Wellman P Sabes Z Ghahramani T Pressburger G Overton J Aaronson B Fischer D Thomas L Saul J Malik C Bishop M Jordan J Kosecka S Singh N Lawrence D Cohn M Meila Q Morris A Barto S Russell R Blasi D Rumelhart R Jacobs T Jaakkola J Weber A Ng P Debevec J seck L Xu P Hrensen E Alpaydin M Atkinson N de Freitas L Daynes K Murphy T PrintezisY Weiss S Spence M Vanter C Taylor D Young S MacDonell P Sallis R Kilgour

clustering

A Jones M Faghihi S Jung I Dryden J Ostrowski D Kriegman D Cooper K Nafasi A Lanitis A Hill S Solloway J Graham J Waterton A Brett O Miglino J Haslam G Edwards T Cootes C Hutchinson E Dimauro P Sozou M Mitchell C Jackson G Page D Cunliffe K Walker

Event Handling
!

addition/removal of vertices/edges
graphs generate events

modication 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


http://jung.sourceforge.net

Statistical Analysis
!

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

can use existing Java statistical packages


!

CERN Colt Scientic Library Visual Numeric!s JMSL for Java


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
http://jung.sourceforge.net

Adoption

Users are writing


social network analyses, games, animated graph views, transportation network algorithms, Google Cartography, ...
http://jung.sourceforge.net

Email visualization

Newsgroup Networks

Temporal Egocentric Communication Networks

Open-Source Collaboration

LiveJournal networks

Integrated into an application


http://jung.sourceforge.net

Freeman!s Southern Women


http://jung.sourceforge.net

Shortest Path

Betweenness Centrality
http://jung.sourceforge.net

Small Multiples
[Sun, E1]
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.
http://jung.sourceforge.net

You might also like