All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.googlecode.blaisemath.graph.package.html Maven / Gradle / Ivy

The newest version!


    Graph Theory Package (org.bm.blaise.scio.graph)
    
      

This package contains the primary classes for graphs, including interfaces and default implementations. The main interface is Graph, providing the standard API for working with graphs. The two most important implementations are SparseGraph, where the edges are encoded using lists, and MatrixGraph, where the edges are encoded using arrays.

Standard graphs may be constructed using the methods in GraphFactory, and standard algortihms are contained in the Graphs class. Secondary classes can be used to generate other kinds of graphs: see RandomGraph, DegreeRandomGraph, WattsStrogatzRandomGraph, and PreferentialAttachment.

ContractedGraph and Subgraph generate new graphs based on old ones by either contracting all nodes in a subset to a single node (in the first case), or by focusing only on a subset of nodes (in the second case).

Secondary interfaces include ValuedGraph (vertices have associated values) and WeightedGraph (edges have associated values). Each of these interfaces has implementations as "wrappers" ValuedGraphWrapper, WeightedGraphWrapper, and WeightedValuedGraphWrapper.

Longitudinal graphs are supported with the LongitudinalGraph interface, which provides a time domain, and each time within the domain gives a different "slice". There are two implementations of this: ListLongitudinalGraph, suitable for a list of graphs which occur at discrete times, and IntervalLongitudinalGraph, where a single graph is specified, and vertices/edges each have their own time domains.

Two kinds of layouts are supported: static and iterative. Static layout methods are described by the StaticGraphLayout interface, and iterative layouts by the IterativeGraphLayout interface. The static interface contains a single layout method which returns computed positions of a graph's nodes (with optional parameters). The iterative interface contains a reset method, an iterate method, and a getPoints method.

Multi-threading

New threads are created by {@link com.googlecode.blaisemath.graph.layout.GraphLayoutManager} and {@link com.googlecode.blaisemath.graph.view.LongitudinalGraphManager}, both for executing layout algorithms in background threads. In part to support this, the following classes are designed to be thread-safe:

  • {@link com.googlecode.blaisemath.graph.modules.layout.SpringLayout}
  • {@link com.googlecode.blaisemath.graph.longitudinal.SimultaneousLayout}
  • {@link com.googlecode.blaisemath.graph.GAInstrument}

Any new implementation of {@link com.googlecode.blaisemath.graph.IterativeGraphLayout} should also be thread-safe, given its usage by {@code GraphLayoutManager}.





© 2015 - 2025 Weber Informatics LLC | Privacy Policy