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.)
-
Interface Summary Interface Description DirectedGraph<V,E> A tagging interface for implementations ofGraphthat accept only directed 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 typeVset and a set of edges of typeE.Hypergraph<V,E> A hypergraph, consisting of a set of vertices of typeVand a set of hyperedges of typeEwhich 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.Tree<V,E> A subtype ofGraphwhich is a (directed, rooted) tree.UndirectedGraph<V,E> A tagging interface for extensions ofGraphthat accept only undirected edges. -
Class Summary Class Description AbstractGraph<V,E> Abstract implementation of theGraphinterface.AbstractTypedGraph<V,E> An abstract class for graphs whose edges all have the sameEdgeType.DelegateForest<V,E> An implementation ofForestthat delegates to a specifiedDirectedGraphinstance.DelegateTree<V,E> An implementation ofTreethat delegates to a specified instance ofDirectedGraph.DirectedOrderedSparseMultigraph<V,E> An implementation ofDirectedGraph, suitable for sparse graphs, that orders its vertex and edge collections according to insertion time.DirectedSparseGraph<V,E> An implementation ofDirectedGraphsuitable for sparse graphs.DirectedSparseMultigraph<V,E> An implementation ofDirectedGraph, suitable for sparse graphs, that permits parallel edges.GraphDecorator<V,E> An implementation ofGraphthat delegates its method calls to a constructor-specifiedGraphinstance.ObservableGraph<V,E> A decorator class for graphs which generates eventsOrderedKAryTree<V,E> An implementation ofTreein which each vertex has ≤ k children.OrderedSparseMultigraph<V,E> An implementation ofGraphthat 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 ofHypergraphthat is suitable for sparse graphs and permits parallel edges.SortedSparseMultigraph<V,E> An implementation ofGraphthat is suitable for sparse graphs, orders its vertex and edge collections according to either specifiedComparatorinstances or the natural ordering of their elements, and permits directed, undirected, and parallel edges.SparseGraph<V,E> An implementation ofGraphthat is suitable for sparse graphs and permits both directed and undirected edges.SparseMultigraph<V,E> An implementation ofGraphthat is suitable for sparse graphs and permits directed, undirected, and parallel edges.UndirectedOrderedSparseMultigraph<V,E> An implementation ofUndirectedGraphthat is suitable for sparse graphs, orders its vertex and edge collections according to insertion time, and permits parallel edges.UndirectedSparseGraph<V,E> An implementation ofUndirectedGraphthat is suitable for sparse graphs.UndirectedSparseMultigraph<V,E> An implementation ofUndirectedGraphthat is suitable for sparse graphs and permits parallel edges.