JavaPermutationTools

Overview

JavaPermutationTools (JPT) is a Java library for representing and generating permutations and sequences, as well as performing computation on permutations and sequences. JPT's Permutation class is an efficient object-oriented implementation of a permutation, and includes a variety of methods for manipulating the permutation (e.g., swapping elements, reversing, scrambling, among many others), generating random permutations, and it also supports iterating over permutations. The JPT library also includes implementations of a variety of permutation distance metrics as well as distance metrics on sequences (i.e., Strings, arrays, and other ordered data types). The distance metrics implement a Java interface, provided in the library, that enables easily implementing your own custom distance metrics and interfacing with JPT's other functionality. Additionally, JPT includes implementations of several algorithms for random sampling from arrays.

The JPT source code repository is hosted on GitHub; and is licensed under the GNU General Public License Version 3 (GPLv3). The API documentation is found on this site. The library is regularly published to Maven Central, from which it is easily imported into software projects using Maven and other commonly used build tools. Additionally, there is a GitHub repository of example programs that show basic usage of the JPT library, as well as replication programs that reproduce results found in published papers.

How to Cite

https://doi.org/10.21105/joss.00950

The JPT library originated as part of the research of Vincent A. Cicirello. If you use JPT in your research, please cite the following article which describes the library:

Permutation Distance Measures

The permutation distance measures include the following:

Edit distances: Edit distance measures, where an edit distance is the minimum number of edit operations necessary to transform one permutation into the other:

Edge-based distances: Distance measures when the permutations represent a sequence of edges (e.g., when adjacent permutation elements correspond to edges):

Other distances: Distance measures based on some permutation concept or property:

Sequence Distance Measures

JPT also includes a variety of string distance measures that can be used to measure the distance between a pair of strings or between a pair of arrays of various types. The sequence distance measures all support computing the distance between pairs of arrays of any one primitive type, the distance between pairs of arrays of objects, the distance between pairs of lists, and the distance between pairs of String objects. The distance measures for sequences include the following:

Dependencies

The JavaPermutationTools has minimal dependencies, all of which are our own libraries, and these include the following.

Dependent Libraries

The following libraries depend upon JavaPermutationTools:

Importing from Maven Central

Latest release on Maven Central

To import JPT from the Maven Central repository (if your build tool is Maven), add the following to the dependencies section of your “pom.xml” (for other build tools, see the tool's documentation for the equivalent):

<dependency>
  <groupId>org.cicirello</groupId>
  <artifactId>jpt</artifactId>
  <version>x.y.z</version>
</dependency>

Just replace x.y.z with your desired version of the library.

Java Modules

The library provides a Java module, org.cicirello.jpt. To use in your project, add the following to your module-info.java:


module your.module.name.here {
    requires org.cicirello.jpt;
}

This module includes the org.cicirello.permutations and org.cicirello.sequences packages as well as their subpackages. See the API documentation for details.

Beginning with version 3.0.0, randomization and other math utilities, and some generic utilities, have been moved to a pair of new libraries ρμ and org.cicirello.core, which are now dependencies of JavaPermutationTools. Your dependency manager (see previous section) will handle downloading these for you.

To ease the transition of users of the library who may have been relying on those utilities, we have configured the module-info.java for the org.cicirello.jpt module to require these transitively so that your application should only need to require org.cicirello.jpt to access the functionality of those new modules.

Semantic Versioning

The JPT uses Semantic Versioning with version numbers of the form: MAJOR.MINOR.PATCH, where differences in MAJOR correspond to incompatible API changes, differences in MINOR correspond to introduction of backwards compatible new functionality, and PATCH corresponds to backwards compatible bug fixes.

Development Process

To maintain a high quality library, our development process utilizes the following:

Related Publications

The following papers, many of which are related to fitness landscape analysis, have either used this library, or contributed to it in some way, such as papers about algorithms that are included in the library.