JUNG 2 Basics

This document is a work in progress which describes how to accomplish certain basic tasks in jUNG 2. Please note that this describes an upcoming alpha release, and is not guaranteed to be in complete sync with the CVS version or the most recent release. If you find an error here, please report it to the jung-support forum or mailing list.

There will be many topics that will not be covered on this page (at least at first). If you have specific suggestions or questions, please let us know.

Installing/Building JUNG

See http://jung.sourceforge.net/pmwiki/index.php/Main/BuildingJUNG2 for instructions.

The JUNG 2 Components

JUNG 2 currently consists of the following primary projects. (The specific details of the projects, i.e., what goes where, may change, but the projects themselves are pretty solid.) We've separated things out like this to keep us honest: it makes us unlikely to introduce weird dependencies between different parts of JUNG. Each project builds into its own jar file, and the jars must be available in your classpath in order to use the classes within. To simplify that process, each jung jar file contains a jar manifest, and in that manifest is a Class-Path directive listing all dependencies for the containing jar. This can greatly reduce the verbosity of a runtime classpath declaration as in the following example: Because of the Class-Path directive in jung-samples-2.0.jar this command:

   java -cp jung-samples-2.0.jar samples.graph.VertexImageShaperDemo?

is equivalent to this one-line command:

   java -cp jung-samples-2.0.jar:jung-api-2.0.jar:jung-algorithms-2.0.jar: 
jung-graph-impl-2.0.jar:jung-io-2.0.jar:
jung-visualization-2.0.jar:concurrent-1.3.4.jar:
collections-generic-4.01.jar:colt-1.2.0.jar samples.graph.VertexImageShaperDemo?

Following is a list of the primary projects of jung2, along with their dependencies:

We've tried to minimize dependencies wherever possible; note, for instance, that no jung2 project, other than jung-samples, has a compile or runtime dependency on our specific graph implementations. This leaves you free to create or re-use your own graph implementations that implement our minimal interface requirements in jung-api, and take full advantage of all the rest of jung2.

In addition to the above list of primary projects, there are two experimental projects with demos available:

How To Work with JUNG 2.0

In anticipation of the JUNG Team filling in the information below, Greg Bernstein has been putting together some basic information on how to use JUNG 2.0:

http://www.grotto-networking.com/JUNG/

The JUNG Team is not responsible for the content on that page and has not confirmed that it is correct or up-to-date, but a brief glance suggests that it's at least mostly correct.

Thanks, Greg!

Building a Graph

Basic Visualization

Decorations (Labels, Weights, ...)

Running Algorithms

Valid XHTML 1.0! Valid CSS!