JUNG2-Tutorial - JUNG 2.0 Tutorial Or how to achieve graph...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
JUNG 2.0 Tutorial Or how to achieve graph based nirvana in Java 1 Introduction JUNG2 is a major revision of the popular Java Universal Network/Graph framework. This is a programming tutorial intended to demonstrate and illustrate individual features of JUNG2 with as little extra code as possible. Hence none of the code examples here will show off the combined full power of JUNG2, for that you should try out the very nice example programs that come with JUNG2. Note that the examples in this document have been tested against JUNG2 version 2.0 and this document was last updated April 22 nd , 2009. 1.1 Information on the non-JUNG Library Dependencies JUNG 2 depends on three other libraries: JUnit , Colt , and Common Collections . 1. JUnit is strictly used for testing JUNG. This is hosted at source forge: http://junit.sourceforge.net/ , with a very good separate site at http://www.junit.org/ . This is a very nice methodology for unit testing . Note that JUNG2 unit test provide further coding examples. 2. Commons Collections: This stems from the Apache Jakarta Commons Collections http://jakarta.apache.org/commons/collections/ . However, the current version of this library doesn't use generics and hence loses much of the type safety that JUNG2 provides. Hence others noticed this and produced a version with the same functionality based on generics. The folks at http://larvalabs.com/collections/ have a source forge project http://sourceforge.net/projects/collections/ . Note that JUNG2 uses this and you will need to use a few key interfaces as discussed later in this tutorial 3. Colt: Arguably the best numerical library for Java out there. This was developed at CERN in conjunction with various other research labs. See http://dsd.lbl.gov/~hoschek/colt/ If you hate to have to go back to C++ just to do some fast numerical work, this is the library for you! 2 JUNG2 Graph Basics Though most of us are impressed by JUNG's visualization capabilities. Its easiest to understand what's going on at first without all the extra GUI stuff. To start off, there is an interface Graph<V,E> defined in edu.uci.ics.jung.graph . This interface defines the basic operations that you can perform on a graph. These include: 1. Adding and removing edges and vertices from the graph and getting collections of all edges and vertices in a graph. 2. Getting information concerning the endpoints of an edge in the graph. 3. Getting information concerning vertices in a graph including various degree measures (in-
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
degree, out-degree) and predecessor and successor vertices. There are three other related interfaces: 1. DirectedGraph<V, E> -- This is a “marker” interface which is used to indicate that classes implementing this interface will only support directed edges. 2.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/13/2009 for the course EE 331 taught by Professor Donthavemyschool during the Spring '09 term at Vermont Tech.

Page1 / 16

JUNG2-Tutorial - JUNG 2.0 Tutorial Or how to achieve graph...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online