Package edu.uci.ics.jung.graph
package edu.uci.ics.jung.graph
Interfaces for the JUNG graph types, and some representative implementations.
A graph consists of a set of vertices set and a set of edges which connect the
vertices. The base interface is Hypergraph
, which defines the most
general type of graph; other interfaces (Graph
, DirectedGraph
, etc.)
define more restrictive graph types.
Vertex and edge types are specified at compile type using Java 1.5 generics.
Types of graphs which are supported include (but are not limited to)
- edges (these have have exactly two endpoints, which may or may not be distinct)
- self-loops (edges which connect exactly one vertex)
- directed and undirected edges
- vertices and edges with attributes (for example, weighted edges)
- vertices and edges with different constraints or properties (examples: trees, bipartite graphs, or multimodal)
- parallel edges (multiple edges which connect a single set of vertices)
- internal representations as matrices or as adjacency lists or adjacency maps
- internal representations that order their elements according to insertion time,
natural ordering, or a specified
Comparator
Notes:
- The collections returned by graph instances
should be treated in general as if read-only. While they are not contractually
guaranteed (or required) to be immutable,
these interfaces do not define the outcome if they are mutated.
Mutations should be done via
{add,remove}{Edge,Vertex}
, or in the constructor. - "Wrapper" graphs are available through
GraphDecorator
; these are useful if you want to create a graph implementation that uses another implementation to do the work, and adds some extra behavior. (One example:ObservableGraph
, which notifies registered listeners when graph mutations occur.)
-
ClassDescriptionAbstractGraph<V,
E> Abstract implementation of theGraph
interface.AbstractTypedGraph<V,E> An abstract class for graphs whose edges all have the sameEdgeType
.DelegateForest<V,E> An implementation ofForest
that delegates to a specifiedDirectedGraph
instance.DelegateTree<V,E> An implementation ofTree
that delegates to a specified instance ofDirectedGraph
.DirectedGraph<V,E> A tagging interface for implementations ofGraph
that accept only directed edges.An implementation ofDirectedGraph
, suitable for sparse graphs, that orders its vertex and edge collections according to insertion time.DirectedSparseGraph<V,E> An implementation ofDirectedGraph
suitable for sparse graphs.An implementation ofDirectedGraph
, suitable for sparse graphs, that permits parallel edges.Forest<V,E> An interface for a graph which consists of a collection of rooted directed acyclic graphs.Graph<V,E> A graph consisting of a set of vertices of typeV
set and a set of edges of typeE
.GraphDecorator<V,E> An implementation ofGraph
that delegates its method calls to a constructor-specifiedGraph
instance.Hypergraph<V,E> A hypergraph, consisting of a set of vertices of typeV
and a set of hyperedges of typeE
which connect the vertices.KPartiteGraph<V,E> An interface for graphs whose vertices are each members of one of 2 or more disjoint sets (partitions), and whose edges connect only vertices in distinct partitions.MultiGraph<V,E> A tagging interface which indicates that the implementing graph accepts parallel edges.ObservableGraph<V,E> A decorator class for graphs which generates eventsOrderedKAryTree<V,E> An implementation ofTree
in which each vertex has ≤ k children.An implementation ofGraph
that orders its vertex and edge collections according to insertion time, is suitable for sparse graphs, and permits directed, undirected, and parallel edges.SetHypergraph<V,H> An implementation ofHypergraph
that is suitable for sparse graphs and permits parallel edges.An implementation ofGraph
that is suitable for sparse graphs, orders its vertex and edge collections according to either specifiedComparator
instances or the natural ordering of their elements, and permits directed, undirected, and parallel edges.SparseGraph<V,E> An implementation ofGraph
that is suitable for sparse graphs and permits both directed and undirected edges.SparseMultigraph<V,E> An implementation ofGraph
that is suitable for sparse graphs and permits directed, undirected, and parallel edges.Tree<V,E> A subtype ofGraph
which is a (directed, rooted) tree.UndirectedGraph<V,E> A tagging interface for extensions ofGraph
that accept only undirected edges.An implementation ofUndirectedGraph
that is suitable for sparse graphs, orders its vertex and edge collections according to insertion time, and permits parallel edges.An implementation ofUndirectedGraph
that is suitable for sparse graphs.An implementation ofUndirectedGraph
that is suitable for sparse graphs and permits parallel edges.